Advertisement
6jarjar6

davidstea.com home.js

Nov 19th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($) {
  2.     $(function() {
  3.  
  4.         $("#shop-tea-img").mouseover(function(){
  5.             $(this).css('cursor', 'pointer');
  6.         });
  7.         $("#shop-tea-img").click(function(){
  8.             window.location='our-teas';
  9.         });
  10.         $('#about-us').mouseover(function(){
  11.             $(this).css('cursor','pointer');
  12.         });
  13.         $("#about-us").click(function(){
  14.             window.location='about-us';
  15.         });
  16.         $('#tea-of-mnth').mouseover(function(){
  17.             $(this).css('cursor','pointer');
  18.         });
  19.         $("#tea-of-mnth").click(function(){
  20.             window.location='teas-of-the-month';
  21.         });
  22.        
  23.         // Selecting first menu item
  24.         if( $("#tbCN").val() ===  "815EB6371535") {
  25.             $("#subnav").find("li.dropdown.level1").first().addClass("open");
  26.         }
  27.  
  28.         // scrollTo functionality
  29.         //================================================
  30.  
  31.         var hand = function(){ $(this).css('cursor', 'pointer') };
  32.    
  33.         // feature1 image
  34.         //---------------
  35.         $('#Image-Maps_03 > .circle2').on('click', function(){
  36.             $.scrollTo( '#feature2', 1800, {offset: {top: -83, left: 0}});
  37.         });
  38.         $('#Image-Maps_03 > .circle2').mouseover(hand);
  39.        
  40.  
  41.         $('#Image-Maps_03 > .circle3').on('click', function(){
  42.             $.scrollTo( '#feature3', 1800, {offset: {top: -83, left: 0}});
  43.         });
  44.         $('#Image-Maps_03 > .circle3').mouseover(hand);
  45.  
  46.  
  47.         $('#Image-Maps_03 > .circle4').on('click', function(){
  48.             $.scrollTo( '#feature4', 1800, {offset: {top: -83, left: 0}});
  49.         });
  50.         $('#Image-Maps_03 > .circle4').mouseover(hand);
  51.  
  52.  
  53.         // feature2 image
  54.         //---------------
  55.         $('#Image-Maps_08 > .circle1').on('click', function(){
  56.             $.scrollTo( '#feature1', 1800, {offset: {top: -83, left: 0}});
  57.         });
  58.         $('#Image-Maps_08 > .circle1').mouseover(hand);
  59.  
  60.  
  61.         $('#Image-Maps_08 > .circle3').on('click', function(){
  62.             $.scrollTo( '#feature3', 1800, {offset: {top: -83, left: 0}});
  63.         });
  64.         $('#Image-Maps_08 > .circle3').mouseover(hand);
  65.  
  66.  
  67.         $('#Image-Maps_08 > .circle4').on('click', function(){
  68.             $.scrollTo( '#feature4', 1800, {offset: {top: -83, left: 0}});
  69.         });
  70.         $('#Image-Maps_08 > .circle4').mouseover(hand);
  71.  
  72.  
  73.         // feature3 image
  74.         //---------------
  75.         $('#Image-Maps_11 > .circle1').on('click', function(){
  76.             $.scrollTo( '#feature1', 1800, {offset: {top: -83, left: 0}});
  77.         });
  78.         $('#Image-Maps_11 > .circle1').mouseover(hand);
  79.  
  80.  
  81.         $('#Image-Maps_11 > .circle2').on('click', function(){
  82.             $.scrollTo( '#feature2', 1800, {offset: {top: -83, left: 0}});
  83.         });
  84.         $('#Image-Maps_11 > .circle2').mouseover(hand);
  85.  
  86.  
  87.         $('#Image-Maps_11 > .circle4').on('click', function(){
  88.             $.scrollTo( '#feature4', 1800, {offset: {top: -83, left: 0}});
  89.         });
  90.         $('#Image-Maps_11 > .circle4').mouseover(hand);
  91.  
  92.  
  93.  
  94.  
  95.         // feature4 image
  96.         //---------------
  97.         $('#Image-Maps_13 > .circle1').on('click', function(){
  98.             $.scrollTo( '#feature1', 1800, {offset: {top: -83, left: 0}});
  99.         });
  100.         $('#Image-Maps_13 > .circle1').mouseover(hand);
  101.  
  102.  
  103.         $('#Image-Maps_13 > .circle2').on('click', function(){
  104.             $.scrollTo( '#feature2', 1800, {offset: {top: -83, left: 0}});
  105.         });
  106.         $('#Image-Maps_13 > .circle2').mouseover(hand);
  107.  
  108.  
  109.         $('#Image-Maps_13 > .circle3').on('click', function(){
  110.             $.scrollTo( '#feature3', 1800, {offset: {top: -83, left: 0}});
  111.         });
  112.         $('#Image-Maps_13 > .circle3').mouseover(hand);
  113.  
  114.         // Store Locator
  115.         $(".home-page").on("click", "#locate-a-store", function() {
  116.             var zipCode = $("#zip-code").val();
  117.             console.log("click" );
  118.             if( zipCode ) {
  119.                 window.location = "store-locator?&ZIPCODE=" + zipCode;
  120.             } else {
  121.                 // No Zip Code Entered
  122.             }
  123.         });
  124.  
  125.  
  126.         //newsletter
  127.         //--------------
  128.         $('button#newsletter-register').click( function () {
  129.             var $newsletterForm = $('#mc-embedded-subscribe-form');
  130.             $newsletterForm.validate();
  131.             if( $newsletterForm.valid() ) $newsletterForm.submit();
  132.         });
  133.  
  134.     }); //document ready ends
  135.  
  136. })(jQuery); //self invoking function ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement