Home > Not Working > Javascript Scrolltop Not Working In Firefox -jquery

Javascript Scrolltop Not Working In Firefox -jquery


Portions of this content are ©1998–2016 by individual mozilla.org contributors. Paulie_D # February 21, 2014 at 4:18 am Do you have a link? If set to a value less than 0, scrollTop is set to 0. It is made possible through sponsorships from products and services we like. *May or may not contain any actual "CSS" or "Tricks". http://qrwsoftware.com/not-working/javascript-scrolltop-not-working-in-firefox.html

Contact About Archives Advertise Guest Posting License Shop Subscribe RSS Skip to main content Select language Skip to search mozilla Mozilla Developer Network Sign in Web Technologies Technologies HTML CSS JavaScript more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Paulie_D # February 21, 2014 at 5:10 am Then I'm afraid I do not have a solution…perhaps it's a JQuery/Firefox bug? Which security measures make sense for a static web site? http://stackoverflow.com/questions/17776544/jquery-scrolltop-firefox-not-working

Javascript Scrolltop Not Working In Firefox -jquery

Does .animate(ScrollTop:) not work in Firefox? Scroll Position You cannot use $('html,body').scrollTop() to find the current scroll position of the page - at least Chrome doesn't support this (always returns 0). Thanks!

For verification run the following jsfiddle in both chrome and firefox: http://jsfiddle.net/RBBw5/6/ share|improve this answer edited Mar 28 '14 at 15:00 Jeff Gandt 14819 answered Oct 17 '12 at 19:01 f_martinez more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation What specifically did Hillary Clinton say or do, to seem untrustworthy to Americans? Firefox Get Scrolltop Browse other questions tagged javascript jquery jquery-selectors scroll or ask your own question.

Any ideas or hack to make it work smoothly in firefox? Firefox Scrolltop Always 0 From the liberal use of $, I assume you are using jQuery. http://www.greyhoundpets.com/greyhounds.php Near the top of the page, you'll see a "Select name" pull-down list. This button also uses the jQuery scrollTop function and it still works in FF36.

So: $('html, body').animate({scrollTop:0},500); will scroll to the top of the browser in half a second. Jquery Animate Scrolltop Not Working In Chrome Categories CSS Combat JavaScript Jungle Design Den Back End Other Discussions We have a pretty good* newsletter. I was allowed to enter the airport terminal by showing a boarding pass for a future flight. share|improve this answer answered Feb 2 '14 at 12:41 Boaz 11.1k53151 add a comment| up vote 0 down vote Use var scrollTop = $('html').scrollTop(); works for FireFox You'll need to sniff

Firefox Scrolltop Always 0

So the question is: why is it necessary to specify a context for the selector in firefox but not in chrome? –jthe Feb 4 '14 at 15:49 add a comment| 3 chris_upjohn 2013-05-10 04:38:19 UTC #3 Firefox is a little weird in this area as you need to animate both the and elements, typically animating only the element is Javascript Scrolltop Not Working In Firefox -jquery Thanks peterjonson82 2013-05-10 04:35:53 UTC #2 Hey Zany90, I checked it on all browser it's working properly without any issues. Document.body.scrolltop Firefox Magnetic effect on AC circuits?

Please ask a new question if you need help. his comment is here Did the Gang of Four really thoroughly explore "Pattern Space"? As you say, it's odd that this didn't appear to be an issue until FF36. Recover lost or missing Bookmarks Firefox Marketplace Apps Stop Working on Firefox 48+ for Windows, Mac, and Linux Remove a toolbar that has taken over your Firefox search or home page Firefox Body Scrolltop

Will the logicians escape from eternal imprisonment? Isn't it ridiculous how the easiest things turn out hardest to figure out? –seanlevan Jul 21 '13 at 20:52 Yes you're right. A Web Design and Development Community. http://qrwsoftware.com/not-working/jquery-scrolltop-div-not-working.html Why, in website galleries, such as NASCAR, does Firefox stop functioning after 3 or 4 photos?

How you can help. Animate Not Working In Firefox padding-bottom Left Top Right Bottom margin-top margin-bottom border-top border-bottom Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'scrollTop' in that specification. jscher2000 Top 10 Contributor 5720 solutions 47098 answers Posted 3/5/15, 12:32 PM Chosen Solution If I edit your button's onclick handler to your actual script, it works: Support Forum This thread was archived.

The script still works under Chrome and IE, so it must be an issue with FF. Or is it? I'm basically doing this so when I scroll past a point, I change the opacity of an element. Jquery Animate Not Working In Firefox share|improve this answer edited Feb 4 '14 at 23:01 Boaz 11.1k53151 answered Oct 17 '13 at 6:11 Matt Robinson 1 add a comment| Your Answer draft saved draft discarded Sign

We're not affiliated or endorsed by the Mozilla Corporation but we love them just the same. Should I be concerned about "security"? When an element content does not generate a vertical scrollbar, then its scrollTop value defaults to 0. navigate here Jan 19 '15 at 22:06 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using

For some browsers body is the answer, for others html is the solution. more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation It seems to be a Firefox issue. –jthe Feb 4 '14 at 15:47 Indeed $("body, html").scrollTop(0) is working also in firefox. If you haven’t previously confirmed a subscription to a Mozilla-related newsletter you may have to do so.

It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. Senff # February 21, 2014 at 8:39 am Out of the box, scrollto works fine in Firefox (mine at least): http://codepen.io/senff/full/ILgxw Paulie_D # February 21, 2014 at 8:47 am Out of Why do most microwaves open from the right to the left? Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

share|improve this answer edited Aug 25 at 17:07 answered Oct 20 '15 at 10:17 dewd 2,40521329 add a comment| up vote 6 down vote Use window if you want consistency between This should scroll to the requested name, but does not. Edit: Edited with JSFiddle and full script :) as attached to an onscroll event javascript jquery scrolltop share|improve this question edited Jul 22 '14 at 19:09 Hors Sujet 4,13511545 asked Jul I don't know why that wasn't a problem in the past, but perhaps if you rename your function to something like scrollToName() that will resolve it?

You can reset it. Related 148Animate scrollTop not working in firefox5JQuery animate scrollTop Not Working Properly3The same old issue, .scrollTop(0) not working in Chrome & Safari19Can't get scrollTop() to work in both Chrome & Firefox1jQuery asked 4 years ago viewed 13156 times active 2 years ago Upcoming Events 2016 Community Moderator Election ends in 7 days Blog How We Make Money at Stack Overflow: 2016 Edition Paulie_D # February 21, 2014 at 5:13 am http://stackoverflow.com/questions/17776544/jquery-scrolltop-firefox-not-working ??

Back to top