1/*global jQuery:false */ 2jQuery(document).ready(function($) { 3 "use strict"; 4 5 6 (function() { 7 8 var $menu = $('.navigation nav'), 9 optionsList = '<option value="" selected>Go to..</option>'; 10 11 $menu.find('li').each(function() { 12 var $this = $(this), 13 $anchor = $this.children('a'), 14 depth = $this.parents('ul').length - 1, 15 indent = ''; 16 17 if (depth) { 18 while (depth > 0) { 19 indent += ' - '; 20 depth--; 21 } 22 23 } 24 $(".nav li").parent().addClass("bold"); 25 26 optionsList += '<option value="' + $anchor.attr('href') + '">' + indent + ' ' + $anchor.text() + '</option>'; 27 }).end() 28 .after('<select class="selectmenu">' + optionsList + '</select>'); 29 30 $('select.selectmenu').on('change', function() { 31 window.location = $(this).val(); 32 }); 33 34 })(); 35 36 37 $('.toggle-link').each(function() { 38 $(this).click(function() { 39 var state = 'open'; //assume target is closed & needs opening 40 var target = $(this).attr('data-target'); 41 var targetState = $(this).attr('data-target-state'); 42 43 //allows trigger link to say target is open & should be closed 44 if (typeof targetState !== 'undefined' && targetState !== false) { 45 state = targetState; 46 } 47 48 if (state == 'undefined') { 49 state = 'open'; 50 } 51 52 $(target).toggleClass('toggle-link-' + state); 53 $(this).toggleClass(state); 54 }); 55 }); 56 57 //add some elements with animate effect 58 59 $(".big-cta").hover( 60 function() { 61 $('.cta a').addClass("animated shake"); 62 }, 63 function() { 64 $('.cta a').removeClass("animated shake"); 65 } 66 ); 67 $(".box").hover( 68 function() { 69 $(this).find('.icon').addClass("animated pulse"); 70 $(this).find('.text').addClass("animated fadeInUp"); 71 $(this).find('.image').addClass("animated fadeInDown"); 72 }, 73 function() { 74 $(this).find('.icon').removeClass("animated pulse"); 75 $(this).find('.text').removeClass("animated fadeInUp"); 76 $(this).find('.image').removeClass("animated fadeInDown"); 77 } 78 ); 79 80 81 $('.accordion').on('show', function(e) { 82 83 $(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active'); 84 $(e.target).prev('.accordion-heading').find('.accordion-toggle i').removeClass('icon-plus'); 85 $(e.target).prev('.accordion-heading').find('.accordion-toggle i').addClass('icon-minus'); 86 }); 87 88 $('.accordion').on('hide', function(e) { 89 $(this).find('.accordion-toggle').not($(e.target)).removeClass('active'); 90 $(this).find('.accordion-toggle i').not($(e.target)).removeClass('icon-minus'); 91 $(this).find('.accordion-toggle i').not($(e.target)).addClass('icon-plus'); 92 }); 93 94 95 96 //Navi hover 97 $('ul.nav li.dropdown').hover(function() { 98 $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(); 99 }, function() { 100 $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(); 101 }); 102 103 // tooltip 104 $('.social-network li a, .options_box .color a').tooltip(); 105 106 // fancybox 107 $(".fancybox").fancybox({ 108 padding: 0, 109 autoResize: true, 110 beforeShow: function() { 111 this.title = $(this.element).attr('title'); 112 this.title = '<h4>' + this.title + '</h4>' + '<p>' + $(this.element).parent().find('img').attr('alt') + '</p>'; 113 }, 114 helpers: { 115 title: { 116 type: 'inside' 117 }, 118 } 119 }); 120 121 122 //scroll to top 123 $(window).scroll(function() { 124 if ($(this).scrollTop() > 100) { 125 $('.scrollup').fadeIn(); 126 } else { 127 $('.scrollup').fadeOut(); 128 } 129 }); 130 $('.scrollup').click(function() { 131 $("html, body").animate({ 132 scrollTop: 0 133 }, 1000); 134 return false; 135 }); 136 137 $('#mycarousel').jcarousel(); 138 $('#mycarousel1').jcarousel(); 139 140 //flexslider 141 $('.flexslider').flexslider(); 142 143 //nivo slider 144 $('.nivo-slider').nivoSlider({ 145 effect: 'random', // Specify sets like: 'fold,fade,sliceDown' 146 slices: 15, // For slice animations 147 boxCols: 8, // For box animations 148 boxRows: 4, // For box animations 149 animSpeed: 500, // Slide transition speed 150 pauseTime: 5000, // How long each slide will show 151 startSlide: 0, // Set starting Slide (0 index) 152 directionNav: true, // Next & Prev navigation 153 controlNav: false, // 1,2,3... navigation 154 controlNavThumbs: false, // Use thumbnails for Control Nav 155 pauseOnHover: true, // Stop animation while hovering 156 manualAdvance: false, // Force manual transitions 157 prevText: '', // Prev directionNav text 158 nextText: '', // Next directionNav text 159 randomStart: false, // Start on a random slide 160 beforeChange: function() {}, // Triggers before a slide transition 161 afterChange: function() {}, // Triggers after a slide transition 162 slideshowEnd: function() {}, // Triggers after all slides have been shown 163 lastSlide: function() {}, // Triggers when last slide is shown 164 afterLoad: function() {} // Triggers when slider has loaded 165 }); 166 167 // Da Sliders 168 if ($('#da-slider').length) { 169 $('#da-slider').cslider(); 170 } 171
172 //slitslider 173 var Page = (function() { 174 175 var $nav = $('#nav-dots > span'), 176 slitslider = $('#slider').slitslider({ 177 onBeforeChange: function(slide, pos) { 178 $nav.removeClass('nav-dot-current'); 179 $nav.eq(pos).addClass('nav-dot-current'); 180 } 181 }), 182 183 init = function() { 184 initEvents(); 185 }, 186 initEvents = function() { 187 $nav.each(function(i) { 188 $(this).on('click', function() { 189 var $dot = $(this); 190 191 if (!slitslider.isActive()) { 192 $nav.removeClass('nav-dot-current'); 193 $dot.addClass('nav-dot-current'); 194 } 195 196 slitslider.jump(i + 1); 197 return false; 198 199 }); 200 201 }); 202 203 }; 204 205 return { 206 init: init 207 }; 208 })(); 209 210 Page.init(); 211 212});
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.