Skip to content Skip to sidebar Skip to footer

Query Scrollto Does Not Work In Firefox

I'm using the scrollTo jquery library in a page I'm building, and it works with Chrome, Safari, and IE 8/9, but not with firefox. Firebug tells me, TypeError: $('#wrapper').scrollT

Solution 1:

SOLUTION:

Well, it seems a popup blocker caused a conflict! The OP found that Kaspersky installed a security add on in firefox, and was blocking scrollTo.

More: http://github.com/mootools/mootools-core/issues/2202

ORIGINAL POST:

I sometimes get that error when my jQuery code is not enclosed in a $(document).ready(function() {...your jquery statements here ...}); block.

Your function doesn't have to be inside doc ready but the statement that calls it should be.

Solution 2:

Works for me (fiddle). Did you include jQuery in your html?

This is how you can do it (BEFORE your ScrollTo library, of course):

<scriptsrc="http://code.jquery.com/jquery-latest.min.js"type="text/javascript"></script>

Solution 3:

Instead of using scrollTo I used scrollIntoView and it worked in FireFox, Chrome and IE.

Example :

var element = document.querySelector('.navbar-brand');
element.scrollIntoView();

Post a Comment for "Query Scrollto Does Not Work In Firefox"