1/* Table OF Contents 2 ========================== 3 Carousel 4 Customs Script [Modal Thumb | List View Grid View + Add to Wishlist Click Event + Others ] 5 Custom Parallax 6 Custom Scrollbar 7 Custom animated.css effect 8 Equal height ( subcategory thumb) 9 responsive fix 10 */ 11$(document).ready(function() { 12 13 /*================================== 14 Carousel 15 ====================================*/ 16 17 // NEW ARRIVALS Carousel 18 $("#productslider").owlCarousel({ 19 navigation: true, 20 items: 4, 21 itemsTablet: [768, 2] 22 }); 23 24 25 // BRAND carousel 26 var owl = $(".brand-carousel"); 27 28 owl.owlCarousel({ 29 //navigation : true, // Show next and prev buttons 30 navigation: false, 31 pagination: false, 32 items: 8, 33 itemsTablet: [768, 4], 34 itemsMobile: [400, 2] 35 36 37 }); 38 39 // Custom Navigation Events 40 $("#nextBrand").click(function() { 41 owl.trigger('owl.next'); 42 }); 43 $("#prevBrand").click(function() { 44 owl.trigger('owl.prev'); 45 }); 46 47 48 // YOU MAY ALSO LIKE carousel 49 50 $("#SimilarProductSlider").owlCarousel({ 51 navigation: true 52 53 }); 54 55 $("#SimilarProductSlider2").owlCarousel({ 56 navigation: true 57 58 }); 59 60 $("#SimilarProductSlider3").owlCarousel({ 61 navigation: true 62 63 }); 64 65 66 // Home Look 2 || Single product showcase 67 68 // productShowCase carousel 69 var pshowcase = $("#productShowCase"); 70 71 pshowcase.owlCarousel({ 72 autoPlay : 12000, 73 stopOnHover: true, 74 navigation: false, 75 paginationSpeed: 2000, 76 goToFirstSpeed: 6000, 77 singleItem: true, 78 autoHeight: true 79 80 81 }); 82 83 // Custom Navigation Events 84 $("#ps-next").click(function() { 85 pshowcase.trigger('owl.next'); 86 }); 87 $("#ps-prev").click(function() { 88 pshowcase.trigger('owl.prev'); 89 }); 90 91 92 93 // Home Look 3 || image Slider 94 95 // imageShowCase carousel 96 var imageShowCase = $("#imageShowCase"); 97 98 imageShowCase.owlCarousel({ 99 autoPlay: 4000, 100 stopOnHover: true, 101 navigation: false, 102 pagination: false, 103 paginationSpeed: 1000, 104 goToFirstSpeed: 2000, 105 singleItem: true, 106 autoHeight: true 107 108 109 }); 110 111 // Custom Navigation Events 112 $("#ps-next").click(function() { 113 imageShowCase.trigger('owl.next'); 114 }); 115 $("#ps-prev").click(function() { 116 imageShowCase.trigger('owl.prev'); 117 }); 118 119 120 /*================================== 121 Customs Script 122 ====================================*/ 123 124 // Product Details Modal Change large image when click thumb image 125 $(".modal-product-thumb a").click(function(){ 126 var largeImage= $(this).find("img").attr('data-large'); 127 $(".product-largeimg").attr('src',largeImage); 128 $(".zoomImg").attr('src',largeImage); 129 }); 130 131 // collapse according add active class 132 $('.collapseWill').on('click', function(e) { 133 $(this).toggleClass("pressed"); //you can list several class names 134 e.preventDefault(); 135 }); 136 137 $('.search-box .getFullSearch').on('click', function(e) { 138 $('.search-full').addClass("active"); //you can list several class names 139 e.preventDefault(); 140 }); 141 142 $('.search-close').on('click', function(e) { 143 $('.search-full').removeClass("active"); //you can list several class names 144 e.preventDefault(); 145 }); 146 147 148 149 // Customs tree menu script 150 $(".dropdown-tree-a").click(function() { //use a class, since your ID gets mangled 151 $(this).parent('.dropdown-tree').toggleClass("open-tree active"); //add the class to the clicked element 152 }); 153 154 155 // Add to Wishlist Click Event // Only For Demo Purpose 156 157 function addToWishlist(prodid) { 158 159 $.ajax({
160 type: 'POST', 161 url: '/post.php', 162 data: 'action=addWish&prodid=' + prodid, 163 dataType: 'json', 164 success: function(data) { 165 if (data.added) { 166 bootbox.alert('Successfully added "' + data.title + '" to your short list!'); 167 $('ul.userMenu > li > a > span.badger').html(data.count); 168 } else { 169 bootbox.alert('"' + data.title + '" is already in your wishlist!'); 170 } 171 } 172 }); 173 } 174 function remToWishlist(prodid) { 175 176 $.ajax({ 177 type: 'POST', 178 url: '/post.php', 179 data: 'action=deleteWish&prodid=' + prodid, 180 dataType: 'json', 181 success: function(data) { 182 bootbox.alert('Removed from my wishlist!', function() { 183 // any code you want to happen after the alert is dismissed 184 window.location = "https://" + window.location.hostname + '/gallery/?find=5' ; 185 }); 186 } 187 }); 188 } 189 190 $('#add-fav').click(function(e) { 191 e.preventDefault(); 192 var prodid = $(this).data('prodid'); 193 addToWishlist(prodid); 194 }); 195 196 $('.add-fav').click(function(e) { 197 e.preventDefault(); 198 var prodid = $(this).parent().find('button').data('prodid'); 199 if (typeof prodid === 'undefined') { 200 prodid = $(this).parent().find('a.btn').data('prodid'); 201 } 202 $(this).addClass("active"); // ADD TO WISH LIST BUTTON 203 $(this).attr('data-original-title', 'Added to Short list'); // Change Tooltip text 204 addToWishlist(prodid); 205 }); 206 207 $('.rem-fav').click(function(e) { 208 e.preventDefault(); 209 var prodid = $(this).parent().find('button').data('prodid'); 210 if (typeof prodid === 'undefined') { 211 prodid = $(this).parent().find('a.btn').data('prodid'); 212 } 213 $(this).addClass("active"); // ADD TO WISH LIST BUTTON 214 $(this).attr('data-original-title', 'Removed Short list'); // Change Tooltip text 215 remToWishlist(prodid); 216 }); 217 218 // Load the containers and apply masonary 219 var $container = $('#coll_container'); 220 $container.imagesLoaded(function () { 221 $container.masonry({ 222 itemSelector: '.rounded_coll' 223 }); 224 }); 225 226 // List view and Grid view 227 228 // 229 // Pictures only 230 // 231 $('.select-list-view').click(function(e) { //use a class, since your ID gets mangled 232 e.preventDefault(); 233 var dataid = $(this).attr("data-id"); 234 if (dataid > 0) { 235 var dataid_add = dataid; 236 } else { 237 $('.select-list-view').addClass("highlight-select"); //add the class to the clicked element 238 $('.select-grid-view').removeClass("highlight-select"); 239 eraseCookie('grid'); 240 createCookie('list', 1, 1); 241 var dataid_add = ''; 242 } 243 $('.member_class_text'+dataid_add).addClass("member_class_text_none"); //add the class to the clicked element 244 $('.quickview'+dataid_add).removeClass("member_class_text_none"); //add the class to the clicked element 245 $('.cref_viewers'+dataid_add).removeClass("member_class_text_none"); 246 247 var $container = $('#containers'); 248 $container.masonry({ 249 itemSelector: '.itemg' 250 }); 251 }); 252 253 // 254 // Pictures with description 255 // 256 257 $('.select-grid-view').click(function(e) { //use a class, since your ID gets mangled 258 e.preventDefault(); 259 260 var dataid = $(this).attr("data-id"); 261 if (dataid > 0) { 262 var dataid_add = dataid; 263 } else { 264 $('.select-list-view').removeClass("highlight-select"); 265 $('.select-grid-view').addClass("highlight-select"); //add the class to the clicked element 266 eraseCookie('list'); 267 createCookie('grid', 1, 1); 268 var dataid_add = ''; 269 } 270 271 $('.member_class_text'+dataid_add).removeClass("member_class_text_none"); //add the class to the clicked elemen 272 $('.quickview'+dataid_add).addClass("member_class_text_none"); //add the class to the clicked element 273 $('.cref_viewers'+dataid_add).addClass("member_class_text_none"); 274 275 276 277 var $container = $('#containers'); 278 $container.masonry({ 279 itemSelector: '.itemg' 280 }); 281 282 283 284 285 });
286 287 function createCookie(name, value, days) { 288 var expires; 289 290 if (days) { 291 var date = new Date(); 292 date.setTime(date.getTime() + (days * 60 * 60 * 1000)); 293 expires = "; expires=" + date.toGMTString(); 294 } else { 295 expires = ""; 296 } 297 document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/"; 298 } 299 300 function eraseCookie(name) { 301 createCookie(name, "", -1); 302 } 303 304 305 // product details color switch 306 $(".swatches li").click(function() { 307 $(".swatches li.selected").removeClass("selected"); 308 $(this).addClass('selected'); 309 310 }); 311 312 // Modal thumb link selected 313 $(".modal-product-thumb a").click(function() { 314 $(".modal-product-thumb a.selected").removeClass("selected"); 315 $(this).addClass('selected'); 316 317 }); 318 319 320 if (/IEMobile/i.test(navigator.userAgent)) { 321 // Detect windows phone//.. 322 $('.navbar-brand').addClass('windowsphone'); 323 } 324 325 326 327 // top navbar IE & Mobile Device fix 328 var isMobile = function() { 329 //console.log("Navigator: " + navigator.userAgent); 330 return /(iphone|ipod|ipad|android|blackberry|windows ce|palm|symbian)/i.test(navigator.userAgent); 331 }; 332 333 334 if (isMobile()) { 335 // For mobile , ipad, tab 336 337 } else { 338 339 340 $(function() { 341 342 //Keep track of last scroll 343 var tshopScroll = 0; 344 $(window).scroll(function(event) { 345 //Sets the current scroll position 346 var ts = $(this).scrollTop(); 347 //Determines up-or-down scrolling 348 if (ts > tshopScroll) { 349 // downward-scrolling 350 $('.navbar').addClass('stuck'); 351 352 } else { 353 // upward-scrolling 354 $('.navbar').removeClass('stuck'); 355 } 356 357 if (ts < 200) { 358 // downward-scrolling 359 $('.navbar').removeClass('stuck'); 360 //alert() 361 } 362 363 364 tshopScroll = ts; 365 366 //Updates scroll position 367 368 }); 369 }); 370 371 372 373 } // end Desktop else 374 375 376 377 378 /*================================== 379 Parallax 380 ====================================*/ 381 if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { 382 // Detect ios User // 383 $('.parallax-section').addClass('isios'); 384 $('.navbar-header').addClass('isios'); 385 } 386 387 if (/Android|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 388 // Detect Android User // 389 $('.parallax-section').addClass('isandroid'); 390 } 391 392 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 393 // Detect Mobile User // No parallax 394 $('.parallax-section').addClass('ismobile'); 395 $('.parallaximg').addClass('ismobile'); 396 397 } else { 398 // All Desktop 399 $(window).bind('scroll', function(e) { 400 parallaxScroll(); 401 }); 402 403 function parallaxScroll() { 404 var scrolledY = $(window).scrollTop(); 405 $('.parallaximg').css('marginTop', '' + ((scrolledY * 0.3)) + 'px'); 406 } 407 408 409 if ($(window).width() < 600) {} else { 410 $('.parallax-image-aboutus').parallax("50%", 0, 0.2, true); 411 } 412 } 413 414 415 /*================================== 416 Custom animated.css effect 417 ====================================*/ 418 419 window.onload = (function() { 420 $(window).scroll(function() { 421 if ($(window).scrollTop() > 86) { 422 // Display something 423 $('.parallax-image-aboutus .animated').removeClass('fadeInDown'); 424 $('.parallax-image-aboutus .animated').addClass('fadeOutUp'); 425 } else { 426 // Display something 427 $('.parallax-image-aboutus .animated').addClass('fadeInDown'); 428 $('.parallax-image-aboutus .animated').removeClass('fadeOutUp'); 429 430 431 } 432 433 if ($(window).scrollTop() > 250) { 434 // Display something 435 } else { 436 // Display something 437 438 } 439 440 }); 441 });
442 443 444 /*======================================================================================= 445 Code for equal height - // your div will never broken if text get overflow 446 ========================================================================================*/ 447 448 $(function() { 449 $('.thumbnail.equalheight').responsiveEqualHeightGrid(); // add class with selector class equalheight 450 }); 451 452 $(function() { 453 $('.featuredImgLook2 .inner').responsiveEqualHeightGrid(); // add class with selector class equalheight 454 }); 455 456 $(function() { 457 $('.featuredImageLook3 .inner').responsiveEqualHeightGrid(); // add class with selector class equalheight 458 }); 459 /*======================================================================================= 460 Code for tablet device || responsive check 461 ========================================================================================*/ 462 463 464 if ($(window).width() < 989) { 465 466 467 // $('.collapseWill').trigger('click'); 468 469 } else { 470 // ('More than 960'); 471 } 472 473 /* $('.collapseWill').trigger('click');*/ 474 475 476 $(".tbtn").click(function() { 477 $(".themeControll").toggleClass("active"); 478 }); 479 480 481 482 483 /*================================== 484 Global Plugin 485 ====================================*/ 486 487 // For stylish input check box 488 489 $(function() { 490 // $("input[type='radio'], input[type='checkbox']").ionCheckRadio(); 491 $("input[name='priceRange']").ionCheckRadio(); 492 $(".smoothscroll input[type='checkbox']").ionCheckRadio(); 493 }); 494 495 496 // customs select by minimalect 497 /* $("select").minimalect({ 498 theme: "bubble" 499 }); 500*/ 501 // cart quantity changer sniper 502 $("input.quanitySniper").TouchSpin({ 503 buttondown_class: "btn btn-link", 504 buttonup_class: "btn btn-link" 505 }); 506 507 // bootstrap tooltip 508 // $('.tooltipHere').tooltip(); 509 $('.tooltipHere').tooltip('hide'); 510 511 512 /*======================================================================================= 513 end 514 ========================================================================================*/ 515 516 var $container = $('#container_artist'); 517 $container.imagesLoaded(function () { 518 $container.masonry({ 519 itemSelector: '.item_artist' 520 }); 521 }); 522 523}); // end Ready
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.