1(function($){"use strict"; 2 3 /** 4 * Copyright 2012, Digital Fusion 5 * Licensed under the MIT license. 6 * http://teamdf.com/jquery-plugins/license/ 7 * 8 * @author Sam Sehnert 9 * @desc A small plugin that checks whether elements are within 10 * the user visible viewport of a web browser. 11 * only accounts for vertical position, not horizontal. 12 */ 13 14 $.fn.visible = function(partial) { 15 if (typeof ($(this).offset()) !== 'undefined') { 16 17 var $t = $(this), 18 $w = $(window), 19 viewTop = $w.scrollTop(), 20 viewBottom = viewTop + $w.height(), 21 _top = $t.offset().top, 22 _bottom = _top + $t.height(), 23 compareTop = partial === true ? _bottom : _top, 24 compareBottom = partial === true ? _top : _bottom; 25 26 return (((compareBottom <= viewBottom) && (compareTop >= viewTop)) || ((compareBottom <= viewBottom) && (compareTop >= viewTop))); 27 } 28 29 }; 30 jQuery(document).ready(function($) { 31 32 var bkWindow = $(window), 33 bkRatingBars = $('.bk-overlay').find('.bk-zero-trigger'), 34 bkthumbnail; 35 36 $('#body-wrapper').imagesLoaded(function(){ 37 setTimeout(function() { 38 bkthumbnail = $('#page-wrap').find('.thumb'); 39 $.each(bkthumbnail, function(i, value) { 40 var bkValue = $(value); 41 if (( bkValue.visible(true) )&& ( bkValue.hasClass('hide-thumb'))) { 42 bkValue.removeClass('hide-thumb'); 43 } 44 }); 45 $.each(bkRatingBars, function(i, value) { 46 var bkValue = $(value); 47 if ( bkValue.visible(true) ) { 48 bkValue.removeClass('bk-zero-trigger'); 49 bkValue.removeClass ('user-score-initial'); 50 bkValue.addClass('bk-bar-ani'); 51 setTimeout(function() { 52 bkValue.find('.bk-criteria-score').removeClass('hide'); 53 },200); 54 } 55 }); 56 },1200); 57 }); 58 59 setTimeout(function() { 60 bkWindow.scroll(function(event) { 61 bkthumbnail = $('#page-wrap').find('.thumb'); 62 if (bkthumbnail != '') { 63 $.each(bkthumbnail, function(i, value) { 64 var bkValue = $(value); 65 if ( ( bkValue.visible(true) ) && ( bkValue.hasClass('hide-thumb') ) ) { 66 bkValue.removeClass('hide-thumb'); 67 } 68 }); 69 $.each(bkRatingBars, function(i, value) { 70 var bkValue = $(value); 71 if ( ( bkValue.visible(true) ) && ( bkValue.hasClass('bk-zero-trigger') ) ) { 72 73 bkValue.removeClass('bk-zero-trigger'); 74 bkValue.removeClass ('user-score-initial'); 75 bkValue.addClass('bk-bar-ani'); 76 setTimeout(function() { 77 bkValue.find('.bk-criteria-score').removeClass('hide'); 78 },200); 79 } 80 }); 81 } 82 }); 83 },2000); 84 85 /* Show bottom single post recommend box */ 86 if ($('.recommend-box')[0]) { 87 var recommend_box = $('.recommend-box'); 88 bkWindow.scroll(function(event) { 89 if ($('.footer').visible(true)){ 90 recommend_box.addClass('recommend-box-on'); 91 } else { 92 recommend_box.removeClass('recommend-box-on'); 93 } 94 }); 95 96 $('.recommend-box .close').click(function(e){ 97 e.preventDefault(); 98 $('.recommend-box').toggleClass('recommend-box-on recommend-box-off'); 99 }); 100 } 101 102 if($('.share-sticky')[0]) { 103 var share_sticky = $('.share-sticky'); 104 if (share_sticky.hasClass('enable')) { 105 share_sticky.addClass('sticky-share-on'); 106 } 107 $('.share-sticky-close').click(function(e){ 108 e.preventDefault(); 109 share_sticky.removeClass('sticky-share-on'); 110 $('.share-sticky-open').css('left','0'); 111 share_sticky.addClass('disable-scroll-effect'); 112 }); 113 $('.share-sticky-open').click(function(e){ 114 e.preventDefault(); 115 share_sticky.addClass('sticky-share-on'); 116 $('.share-sticky-open').css('left','-50px'); 117 share_sticky.removeClass('disable-scroll-effect'); 118 }); 119 } 120 }); 121})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.