1(function($) { 2 /** 3 * Extra JS for the Jenga theme 4 * 5 * 1. positions the different elements: 6 * - arrows 7 * - dots 8 * - caption 9 * - filmstrip 10 */ 11 12 // metaslider has been initilalised 13 $(document).on('metaslider/initialized', function(e, identifier) { 14 // if .ms-theme-architekt 15 if ($(identifier).closest('.metaslider.ms-theme-jenga').length) { 16 var $slider = $(identifier); 17 var $container = $(identifier).closest('.metaslider.ms-theme-jenga'); 18 var captions = $slider.find('.caption'); 19 if (captions.length) { 20 $container.addClass('ms-has-caption'); 21 } 22 $container.addClass('ms-loaded'); 23 } 24 25 // Wrap nav and arrows in a div 26 // When Dots 27 $(".metaslider.has-dots-nav.ms-theme-jenga:not(.has-carousel-mode) .flexslider:not(.filmstrip) > .flex-control-paging, .metaslider.has-dots-nav.ms-theme-jenga:not(.has-carousel-mode) .flexslider:not(.filmstrip) > .flex-direction-nav").wrapAll("<div class='slide-control'></div>"); 28 29 // When Carousel 30 $(".metaslider.ms-theme-jenga.has-carousel-mode .flexslider > .flex-control-paging").wrap("<div class='slide-control'></div>"); 31 32 // When Filmstrip 33 $(".metaslider.ms-theme-jenga.has-filmstrip-nav .flexslider:not(.filmstrip) > .flex-direction-nav").wrap("<div class='slide-control'></div>"); 34 35 // Nivo with dots 36 $(".metaslider.ms-theme-jenga:not(.has-carousel-mode).metaslider-responsive > div > .rslides_nav, .metaslider.ms-theme-jenga:not(.has-carousel-mode).metaslider-responsive > div > .rslides_tabs").wrapAll("<div class='slide-control'></div>"); 37 38 // Nivo wrap arrows 39 $(".metaslider.ms-theme-jenga:not(.has-carousel-mode).metaslider-responsive .slide-control > .rslides_nav").wrapAll("<div class='rslides_arrows'></div>"); 40 41 // Nivo put arrows after dots 42 var nivo_arrows = $(".metaslider.ms-theme-jenga:not(.has-carousel-mode).metaslider-responsive .rslides_arrows"); 43 nivo_arrows.next().insertBefore(nivo_arrows); 44 45 $(window).trigger('resize'); 46 }); 47 48 $(window).on('resize', function(e) { 49 $(function() { 50 // Removed these to give it a height that works for any number of slides. 51 // var controlTotalHeight = controlNavHeight(); 52 // var arrowsTotalHeight = arrowsNavHeight(); 53 $('.metaslider.ms-theme-jenga .slide-control').css({ 54 'position' : 'absolute', 55 'top' : '39%', 56 'height' : "140px", 57 'margin-top' : "-50px" 58 }); 59 }); 60 }); 61 62})(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.