Home › Forums › JavaScript › ScrollTo not working in Firefox?
- This topic is empty.
-
AuthorPosts
-
February 21, 2014 at 3:18 am #163589nickjamesParticipant
ScrollTo jquery is not working in firefox but working in both chrome and opera. Any ideas or hack to make it work smoothly in firefox? Something like this:
function goToByScroll(id){ $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
In firefox, this code does not produce any scrooll to top or bottom effect but stays as it is inactive. I need a way or hack to make it work and it’s a bit urgent. Thanks.
February 21, 2014 at 4:18 am #163591Paulie_DMemberDo you have a link?
February 21, 2014 at 4:25 am #163592nickjamesParticipanthi Paulie, no, I don’t have a link for demo. But scrollTo in jquery is now working. This is a common problem you can see in forums and stackoverflow. What I want is any nice hack or way to get it working?
February 21, 2014 at 4:28 am #163594Paulie_DMemberThis is a common problem you can see in forums and stackoverflow.
What do the other sites suggest?
http://stackoverflow.com/questions/13054194/query-scrollto-does-not-work-in-firefox
February 21, 2014 at 4:30 am #163595nickjamesParticipantI put sample code that does not work in Firefox:
<div style="margin: 100px 100px 1000px 100px"> <div id="test" style="width: 100px; height: 100px; border: 3px solid black;">target object</div> </div> function scrolear(destino){ var stop = $(destino).offset().top; var delay = 1000; $('body,html').animate({scrollTop: stop}, delay); return false; } scrolear('#test');
February 21, 2014 at 4:32 am #163596nickjamesParticipantPaulie, others suggest in stactoverflow sites to put the code as follows:
$('body,html').animate( ... );
But it does not work for me.
February 21, 2014 at 5:10 am #163598Paulie_DMemberThen I’m afraid I do not have a solution…perhaps it’s a JQuery/Firefox bug?
Anyone?
February 21, 2014 at 5:13 am #163599February 21, 2014 at 6:24 am #163617nickjamesParticipantIt’s okay Paulie. Leave it. Hope it will be resolved in upcoming versions of Mozilla firefox. Thanks for your support. But others reading this thread could help notify and disscuss the problem with Github-Firefox.
February 21, 2014 at 8:39 am #163633SenffParticipantOut of the box, scrollto works fine in Firefox (mine at least): http://codepen.io/senff/full/ILgxw
February 21, 2014 at 8:47 am #163634Paulie_DMemberOut of the box, scrollto works fine in Firefox
Ditto
January 28, 2015 at 2:01 pm #194548digitalmarkParticipantTo make it work in FF, I replaced this:
$(“#toTop”).click(function(){
event.preventDefault();
$(“html, body”).animate({scrollTop:0},”slow”);
});with this:
$(“#toTop”).on(‘click’,function(){
$(“html, body”).animate({scrollTop:0},”slow”);
return false;
}); -
AuthorPosts
- The topic ‘ScrollTo not working in Firefox?’ is closed to new replies.