Answer the question
In order to leave comments, you need to log in
Why does it work in chrome but not in firefox?
<script>
$(document).ready(function() {
$('a[href^="#"]').click(function(){
var el = $(this).attr('href');
$('body').animate({
scrollTop: $(el).offset().top}, 700);
return false;
});
});
</script>
<a id="1" name="1"></a>
Answer the question
In order to leave comments, you need to log in
For Firefox you need to use
$('html').animate({
scrollTop: $(el).offset().top}, 700);
});
body
and withhtml
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question