1document.observe('dom:loaded', ('getComputedStyle' in window) ? function() { 2 3 var sliders = $$('.swiper-container'); 4 if (sliders.length > 0) { 5 // initialize sliders 6 sliders.each(function(el){ 7 // get slider config 8 var config = JSON.parse(el.readAttribute('data-config')); 9 10 config.onInit = function(swiper){ 11 // observe click on slides 12 swiper.container[0].select('.easyslide-link').each(function(el){ 13 el.observe('click', function(e) { 14 if (this.hasClassName('target-self')) 15 return true; 16 e.stop(); 17 var options = ''; 18 if (this.hasClassName('target-popup')) 19 options = 'width=600,height=400'; 20 window.open(this.href, this.up().id, options); 21 }); 22 }); 23 // observers to listen mouse hover 24 if (swiper.params.stopOnHover) { 25 swiper.container[0].observe('mouseenter', function(){ 26 this.swiper.stopAutoplay() 27 }); 28 swiper.container[0].observe('mouseleave', function(){ 29 this.swiper.startAutoplay() 30 }); 31 } 32 if (swiper.params.lazyLoading) { 33 swiper.container[0].resizeSlider = function(){ 34 var layout = new Element.Layout(this.down('.swiper-slide-active')); 35 var padding = layout.get('padding-bottom') + layout.get('padding-top'); 36 var w = this.swiper.params.sliderSizeWidth; 37 var h = this.swiper.params.sliderSizeHeight; 38 if (!h || !w) return; 39 var newHeight = this.offsetWidth * (h - padding) / w + padding; 40 this.setStyle({maxHeight: Math.round(newHeight) + 'px'}); 41 }; 42 swiper.container[0].resizeSlider(); 43 } 44 }; 45 46 new Swiper(el, config); 47 }); 48 // observe window resize to resize slider 49 window.easyslideResizeTimer = null; 50 Event.observe(window, 'resize', function(){ 51 clearTimeout(window.easyslideResizeTimer); 52 window.easyslideResizeTimer = setTimeout(function() { 53 $$('.swiper-container').each(function (el){ 54 if (typeof el.resizeSlider !== 'undefined') 55 el.resizeSlider(); 56 }); 57 }, 250); 58 }); 59 } 60 61} : null);
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.