1/* 2 Concept Rotator - v 01 3 2013-11-15 4 All Rights Reserved 5 Last edited: 6 2016-08-23 7 8 CONCEPT Intermedia 9 http://sam3.pl 10 11 12 13 /TO RUN do: 14 15 conceptRotator( jQuery - biblioteka przekazywana by uniknÄ Ä konfliktów, 16 jQuery('#promoted_box') - box zawierajÄ cy wszystkie elementy, potrzebny do zatrzymywania oraz uruchamiania animacji gdy najeżdżamy na boks lursorem 17 jQuery('#promoted_box .last_pageNG') - kontener z obiektami do zmieniania 18 jQuery("#promoted_box .buttons") - kontener z zakÅÄ dkami 19 <?=(count($promoted)-1)?> - iloÅÄ zakÅadek 20 8000 - czas pomiÄdzy przejÅciami 21 ); 22 */ 23if (typeof globalpause == 'undefined') { 24 globalPause=false; 25} 26var conceptRotator = function ($, container, newsContainer, buttonContainer, pMax, pTimeout) { 27 var promotedIndex = 1; 28 var shownIndex = 0; 29 var promotedMax = pMax; 30 var promotedTimeout = pTimeout; 31 var promotedTweenTime = 0.2; 32 var promotedBoxTimeout = null; 33 var myTween; 34 var i = 0; 35 var news = newsContainer.children(); 36 var hasFocus = false; 37 38 $(container).addClass('ci-rotator'); 39 $(buttonContainer).addClass('ci-rotator-buttons'); 40 $(newsContainer).addClass('ci-rotator-news'); 41 42 // IE8 fix 43 for (i = 0; i < news.length; i++) { 44 $(news[i]).attr('data-id',i); 45 $('a',news[i]).attr('data-id',i); 46 //TweenMax.to(news[i], 0, {css: {autoAlpha: 0, zIndex: 0}, overwrite: 5}); 47 jQuery(news[i]).removeClass('js-rotator-shown'); 48 jQuery(news[i]).addClass('js-rotator-hidden'); 49 } 50 //TweenMax.to(news[0], promotedTweenTime, {css: {autoAlpha: 1, zIndex: 1}, overwrite: 5}); 51 jQuery(news[0]).removeClass('js-rotator-hidden'); 52 jQuery(news[0]).addClass('js-rotator-shown'); 53 54 var showPromoted = function (idx) { 55 activateMyGroup(idx, buttonContainer); 56 57 for (var i = 0; i < news.length; i++) { 58 //TweenMax.to(news[i], promotedTweenTime, {css: {autoAlpha: 0, zIndex: 0}, overwrite: 5}); 59 jQuery(news[i]).removeClass('js-rotator-shown'); 60 jQuery(news[i]).addClass('js-rotator-hidden'); 61 } 62 63 promotedIndex = idx; 64 adjustBoxes($(container)); 65 fixConceptRotators($, $(container).parent()); 66 67 //TweenMax.to(news[idx - 1], promotedTweenTime, {css: {autoAlpha: 1, zIndex: 1}, delay: promotedTweenTime / 3 * 2}); 68 jQuery(news[idx-1]).addClass('js-rotator-shown'); 69 jQuery(news[idx-1]).removeClass('js-rotator-hidden'); 70 } 71 72 var startTimer = function(){ 73 promotedBoxTimeout = setTimeout(function () { 74 stopTimer(); 75 if (!globalPause && !hasFocus){ 76 rotatePromoted() 77 } 78 startTimer(); 79 }, promotedTimeout); 80 } 81 var stopTimer = function(){ 82 clearTimeout(promotedBoxTimeout); 83 } 84 85 var rotatePromoted = function () { 86 { 87 if (promotedIndex > promotedMax) 88 promotedIndex = 0; 89 showPromoted(promotedIndex + 1); 90 } 91 } 92 $(container).mouseover(function () { 93 stopTimer(); 94 }); 95 96 $(container).mouseleave(function () { 97 startTimer(); 98 }); 99 100 101 var activateMyGroup = function (cur, buttonContainer) { 102 $(buttonContainer).children().removeClass('sel'); 103 $('div:nth-child(' + cur + '), li:nth-child(' + cur + ')', buttonContainer).addClass('sel'); 104 } 105 106 // configure buttons 107 var buttons = $(buttonContainer).children(); 108 for (i = 1; i <= buttons.length; i++) { 109 $(buttons[i - 1]).data('id', i); 110 } 111 $(buttons).click(function () { 112 showPromoted($(this).data('id')) 113 }); 114 115 startTimer(); 116 117 $('a',newsContainer).focusin(function(){ 118 var myId = parseInt($(this).attr('data-id')) + 1; 119 hasFocus = true; 120 stopTimer(); 121 if (promotedIndex != myId) 122 showPromoted(myId); 123 }); 124 $('a',newsContainer).focusout(function(){ 125 hasFocus = false; 126 startTimer(); 127 }); 128}
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.