1(function($) { 2 'use strict'; 3 $.fn.sqrSpotlight = function() { 4 $(this).each(function() { 5 var stage = $(this), 6 ul = stage.children('ul'), 7 items = ul.children('li'), 8 timer, 9 delay = parseInt(stage.attr('data-delay'), 10), 10 offset = 0; 11 12 function next() { 13 offset++; 14 if (offset >= items.length) offset = 0; 15 setOffset(); 16 } 17 18 function setOffset() { 19 ul.css('transform', 'translateY(-' + items.eq(offset).position().top + 'px)'); 20 stage.css('height', items.eq(offset).outerHeight() + 'px'); 21 } 22 23 function startTimer() { 24 if (timer === undefined) timer = window.setInterval(next, delay * 1000); 25 } 26 27 function stopTimer() { 28 if (timer !== undefined) window.clearInterval(timer); 29 timer = undefined; 30 } 31 32 setOffset(); 33 startTimer(); 34 35 $(window).on('resize', setOffset); 36 stage.on('mouseover', stopTimer); 37 stage.on('mouseout', startTimer); 38 39 }); 40 }; 41})(jQuery); 42 43$(document).ready(function() { 44 $('.sqrspotlight').sqrSpotlight(); 45});
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.