1var curr_media_no = 1, 2 max_media_no = $('.media-gallery-slide').length; 3 4function showMediaItem(media_no){ 5 if(curr_media_no!=media_no){ 6 if(media_no > max_media_no){ 7 showMediaItem(1); 8 } else if(media_no < 1){ 9 showMediaItem(max_media_no); 10 } else{ 11 var currentMedia = $('#media-slide-'+curr_media_no), 12 nextMedia = $('#media-slide-'+media_no); 13 14 nextMedia.css({opacity: 0}).addClass('active').animate({opacity: 1}, 1000); 15 currentMedia.animate({opacity: 0}, 1000).removeClass('active'); 16 17 $('#media-thumb-'+curr_media_no).removeClass('active'); 18 $('#media-thumb-'+media_no).addClass('active'); 19 20 curr_media_no = media_no; 21 } 22 } 23} 24 25$(function(){ 26 $('.media-gallery-slide').css({opacity: 0}); 27 $('.media-gallery-slide.active').css({opacity: 1}); 28 29 $('#media-gallery-prev a').click(function(e){ 30 e.preventDefault(); 31 32 showMediaItem(curr_media_no-1); 33 34 $('.youtube-iframe').each(function(){ 35 this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 36 }); 37 }); 38 39 $('#media-gallery-next a').click(function(e){ 40 e.preventDefault(); 41 42 showMediaItem(curr_media_no+1); 43 44 $('.youtube-iframe').each(function(){ 45 this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 46 }); 47 }); 48 49 $('#media-gallery-thumbs a').click(function(e){ 50 e.preventDefault(); 51 var getMediaId = $(this).prop('id').replace('media-thumb-',''), 52 thumbOptions = $.extend({}, eval('('+$.trim($(this).attr('rel'))+')')); 53 54 showMediaItem(parseInt(getMediaId)); 55 56 if(thumbOptions.isVideo){ 57 $('.youtube-iframe').each(function(){ 58 this.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); 59 }); 60 } else{ 61 $('.youtube-iframe').each(function(){ 62 this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 63 }); 64 } 65 }); 66});
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.