1$(function () { 2 3 4 5 // ------------------------------------------------------- // 6 // Navbar Sticky 7 // ------------------------------------------------------ // 8 $(window).on('scroll', function () { 9 if ($(window).scrollTop() > ($('.top-bar').outerHeight())) { 10 $('header.nav-holder.make-sticky').addClass('sticky'); 11 $('body').css('padding-top', '' + $('#navbar').outerHeight() + 'px'); 12 13 } else { 14 $('header.nav-holder.make-sticky').removeClass('sticky'); 15 $('body').css('padding-top', '0'); 16 } 17 }); 18 19 // ------------------------------------------------------- // 20 // Multi-level dropdown 21 // ------------------------------------------------------ // 22 23 $("ul.dropdown-menu [data-toggle='dropdown']").on("click", function (event) { 24 event.preventDefault(); 25 event.stopPropagation(); 26 27 $(this).siblings().toggleClass("show"); 28 29 30 if (!$(this).next().hasClass('show')) { 31 $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); 32 } 33 $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) { 34 $('.dropdown-submenu .show').removeClass("show"); 35 }); 36 37 }); 38 39 // ------------------------------------------------------- // 40 // Scroll To 41 // ------------------------------------------------------ // 42 $('.scroll-to').on('click', function (e) { 43 44 e.preventDefault(); 45 var full_url = this.href; 46 var parts = full_url.split("#"); 47 var target = parts[1]; 48 49 if ($('header.nav-holder').hasClass('sticky')) { 50 var offset = -80; 51 } else { 52 var offset = -180; 53 } 54 55 var offset = $('header.nav-holder').outerHeight(); 56 57 $('body').scrollTo($('#' + target), 800, { 58 offset: -offset 59 }); 60 61 }); 62 63 64 // ------------------------------------------------------- // 65 // Tooltip Initialization 66 // ------------------------------------------------------ // 67 $('[data-toggle="tooltip"]').tooltip(); 68 69 70 // ------------------------------------------------------- // 71 // Product Gallery Slider 72 // ------------------------------------------------------ // 73 function productDetailGallery() { 74 $('a.thumb').on('click', function (e) { 75 e.preventDefault(); 76 source = $(this).attr('href'); 77 $('#mainImage').find('img').attr('src', source); 78 }); 79 80 for (i = 0; i < 3; i++) { 81 setTimeout(function () { 82 $('a.thumb').eq(i).trigger('click'); 83 }, 300); 84 } 85 } 86 87 productDetailGallery(); 88 89 90 // ------------------------------------------------------- // 91 // Customers Slider 92 // ------------------------------------------------------ // 93 $(".customers").owlCarousel({ 94 responsiveClass: true, 95 responsive: { 96 0: { 97 items: 2 98 }, 99 600: { 100 items: 3 101 }, 102 1000: { 103 items: 6 104 } 105 } 106 }); 107 108 109 // ------------------------------------------------------- // 110 // Testimonials Slider 111 // ------------------------------------------------------ // 112 $(".testimonials").owlCarousel({ 113 items: 4, 114 responsiveClass: true, 115 responsive: { 116 0: { 117 items: 1 118 }, 119 600: { 120 items: 2 121 }, 122 1000: { 123 items: 4 124 } 125 } 126 }); 127 128 129 // ------------------------------------------------------- // 130 // Homepage Slider 131 // ------------------------------------------------------ // 132 $('.homepage').owlCarousel({ 133 loop: true, 134 margin:0, 135 dots: false, 136 nav: false, 137 autoplay: true, 138 smartSpeed: 1000, 139 addClassActive: true, 140 navText: [ 141 "<i class='fa fa-angle-left'></i>", 142 "<i class='fa fa-angle-right'></i>" 143 ], 144 responsiveClass: true, 145 responsive: { 146 0: { 147 items: 1 148 }, 149 600: { 150 items: 1 151 }, 152 1000: { 153 items: 1, 154 loop: true 155 } 156 } 157 });
158 159 // ------------------------------------------------------- // 160 // Adding fade effect to dropdowns 161 // ------------------------------------------------------ // 162 $('.dropdown').on('show.bs.dropdown', function () { 163 $(this).find('.dropdown-menu').first().stop(true, true).fadeIn(100); 164 }); 165 $('.dropdown').on('hide.bs.dropdown', function () { 166 $(this).find('.dropdown-menu').first().stop(true, true).fadeOut(100); 167 }); 168 169 170 // ------------------------------------------------------- // 171 // Project Caroudel 172 // ------------------------------------------------------ // 173 $('.project').owlCarousel({ 174 loop: true, 175 margin: 0, 176 dots: true, 177 nav: true, 178 autoplay: true, 179 smartSpeed: 1000, 180 addClassActive: true, 181 lazyload: true, 182 navText: [ 183 "<i class='fa fa-angle-left'></i>", 184 "<i class='fa fa-angle-right'></i>" 185 ], 186 responsiveClass: true, 187 responsive: { 188 0: { 189 items: 1 190 }, 191 600: { 192 items: 1 193 }, 194 1000: { 195 items: 1, 196 loop: true 197 } 198 } 199 }); 200 201 202 // ------------------------------------------------------- // 203 // jQuery Counter Up 204 // ------------------------------------------------------ // 205 $('.counter').counterUp({ 206 delay: 10, 207 time: 1000 208 }); 209 210 211 // ------------------------------------------------------- // 212 // click on the box activates the radio 213 // ------------------------------------------------------ // 214 $('#checkout').on('click', '.box.shipping-method, .box.payment-method', function (e) { 215 var radio = $(this).find(':radio'); 216 radio.prop('checked', true); 217 }); 218 219 220 // ------------------------------------------------------- // 221 // Bootstrap Select 222 // ------------------------------------------------------ // 223 $('.bs-select').selectpicker({ 224 style: 'btn-light', 225 size: 4 226 }); 227 228 229 // ------------------------------------------------------- // 230 // Shop Detail Carousel 231 // ------------------------------------------------------ // 232 $('.shop-detail-carousel').owlCarousel({ 233 items: 1, 234 thumbs: true, 235 nav: false, 236 dots: false, 237 autoplay: true, 238 thumbsPrerendered: true 239 }); 240 241 242 // ------------------------------------------------------ // 243 // For demo purposes, can be deleted 244 // ------------------------------------------------------ // 245 246 var stylesheet = $('link#theme-stylesheet'); 247 $("<link id='new-stylesheet' rel='stylesheet'>").insertAfter(stylesheet); 248 var alternateColour = $('link#new-stylesheet'); 249 250 if ($.cookie("theme_csspath")) { 251 alternateColour.attr("href", $.cookie("theme_csspath")); 252 } 253 254 $("#colour").change(function () { 255 256 if ($(this).val() !== '') { 257 258 var theme_csspath = 'css/style.' + $(this).val() + '.css'; 259 260 alternateColour.attr("href", theme_csspath); 261 262 $.cookie("theme_csspath", theme_csspath, { 263 expires: 365, 264 path: document.URL.substr(0, document.URL.lastIndexOf('/')) 265 }); 266 267 } 268 269 return false; 270 }); 271 272 if ($.cookie("theme_layout")) { 273 $('body').addClass($.cookie("theme_layout")); 274 } 275 276 $("#layout").change(function () { 277 278 if ($(this).val() !== '') { 279 280 var theme_layout = $(this).val(); 281 282 $('body').removeClass('wide'); 283 $('body').removeClass('boxed'); 284 285 $('body').addClass(theme_layout); 286 287 $.cookie("theme_layout", theme_layout, { 288 expires: 365, 289 path: document.URL.substr(0, document.URL.lastIndexOf('/')) 290 }); 291 } 292 }); 293 294});
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.