$(window).scroll(function() { if ($(window).scrollTop() <= 0) { $("#subpageNavBar").animate({ margin: "37px 0px 0px 0px" }, 0); $('#SubPageShoppingIMG').attr('src', '../img/bag-Dark.png'); } else { $("#subpageNavBar").animate({ margin: "37px 0px 0px 0px" }, 0); $('#SubPageShoppingIMG').attr('src', '../img/bag-Dark.png'); } }); $(window).scroll(function() { if ($(window).scrollTop() <= 0) { $("#mainNav").animate({ margin: "37px 0px 0px 0px" }, 0); $('#ShoppingIMG').attr('src', '../img/bag.png'); } else { $("#mainNav").animate({ margin: "37px 0px 0px 0px" }, 0); $('#ShoppingIMG').attr('src', '../img/bag-Dark.png'); } }); $(window).resize(function() { if ($(window).width() < 767) { $(".navbar-default").animate({ margin: "0 0px 0px 0px" }, 0); } else { $(".navbar-default").animate({ margin: "37px 0px 0px 0px" }, 0); } }); $(function() { var $win = $(window); $win.scroll(function() { if ($win.scrollTop() == 0 && $(window).width() < 767) $(".navbar-default").animate({ margin: "0 0px 0px 0px" }, 0); else if ($win.height() + $win.scrollTop() == $(document).height()) {} }); }); if ($('#back-to-top').length) { var scrollTrigger = 0, // px backToTop = function() { var scrollTop = $(window).scrollTop(); if (scrollTop > scrollTrigger) { $('#back-to-top').addClass('show'); } else { $('#back-to-top').removeClass('show'); } }; backToTop(); $(window).on('scroll', function() { backToTop(); }); $('#back-to-top').on('click', function(e) { e.preventDefault(); $('html,body').animate({ scrollTop: 0 }, 500); }); } $(document).ready(function() { $('.carousel-showmanymoveone .item').each(function() { var itemToClone = $(this); for (var i = 1; i < 3; i++) { itemToClone = itemToClone.next(); if (!itemToClone.length) { itemToClone = $(this).siblings(':first'); } itemToClone.children(':first-child').clone() .addClass("cloneditem-" + (i)) .appendTo($(this)); } }); }); $(".FAQ-Question .FAQ-Answer").hide(); $(".FAQ-Question h5").click(function() { $(this).next(".FAQ-Question .FAQ-Answer").slideToggle(300); }); $('#myCarousel').carousel({ interval: false }); $(document).ready(function(){ $('#carousel-selector-0').trigger('click'); }); // handles the carousel thumbnails $('[id^=carousel-selector-]').click( function(){ var id_selector = $(this).attr("id"); var id = id_selector.substr(id_selector.length -1); id = parseInt(id); $('#myCarousel').carousel(id); $('[id^=carousel-selector-]').removeClass('selected'); $(this).addClass('selected'); }); // when the carousel slides, auto update $('#myCarousel').on('slid', function (e) { var id = $('.item.active').data('slide-number'); id = parseInt(id); $('[id^=carousel-selector-]').removeClass('selected'); $('[id=carousel-selector-'+id+']').addClass('selected'); }); // shopping cart $(".shoppingCart").hide(); $('#shoppingBagbtn').click( function(){ $(".shoppingCart").fadeToggle('fast'); }); // details add to cart $('#addToCartBtn').click( function(){ $(".shoppingCart").fadeIn('fast'); }); $(document).click(function(){ $(".shoppingCart").fadeOut('fast'); }); /* Clicks within the dropdown won't make it past the dropdown itself */ $("#shoppingBagbtn,.shoppingCart,#addToCartBtn").click(function(e){ e.stopPropagation(); }); // onload popup $(window).load(function() { $('#onload').modal('show'); }); // checkform $('.HomeService,#otherServiceFill').hide(); $('#services-06').click(function() { $(".HomeService").slideToggle(this.checked); }); $('#services-07').click(function() { $("#otherServiceFill").slideToggle(this.checked); });