Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Ben Anggoro
Ben Anggoro
36,161 Points

jQuery ScrollTop on Chrome

Hello everyone,

Firstly im sorry if this is out of any treehouse lessons scope but I've been stuck with this & can't figure out why.

I'm using jQuery scroll top with the below :

  $('#scroll-down a').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
  });

This is the project

It works perfectly OK on FF but dead nothin' on chrome. Could anyone please please help show me where I messed up the thing :(

Thanks big time in advance

Hi Ben,

The website works for me in both browsers, but I am using Linux.

Jeff

1 Answer

Ben Anggoro
Ben Anggoro
36,161 Points

Hi Jeff,

Thanks thats good to know. I'm on mac I havent looked at windows yet. It drives me nuts because such a small issue but have consumed most of the time now. Also i am using exactly the same framework as my previous project which is still working just fine so i totally not getting it. The only difference is that now I am using WordPress' own jquery instead of Google library. Would you think that is the problem? But if it is, why it works on FF and linux then ? I havent tried though.