0

I have a site: http://lasociete.ca, if you click Toronto then on the right hand side "go To montreal" it should scroll the site to the right hand side to display the montreal side. Weirdly enough, it was working and now it has stopped working in Chrome, but it works in firefox....

Here is my jQuery

$("#to-montreal").click(function(e){
    e.preventDefault();
    var windowWidth = $(document).width();
    var windowHeight = $(document).height();
    $('body, html').animate({scrollLeft: windowWidth}, 2000);
});

Anyone have any clue why this would stop working in chrome??

jQuery Version 1.11.0

user2820604
  • 281
  • 1
  • 6
  • 15

1 Answers1

0

To get the width of the window, use $(window).width() (not $(document).width()). Have a look at this question for the difference.

Community
  • 1
  • 1
Lg102
  • 4,733
  • 3
  • 38
  • 61