<script src="http://code.jquery.com/jquery.js"> </script>
<script>
jQuery(document).ready(function(){
jQuery('.scrollToTop').click(function(){
$('html, body').animate({
scrollTop: ($("#company_info").first().offset().top)
}, 1200);
});
});
</script>
<body>
<section class="get_started">
<div class="container_12">
<div class="grid_12 relative">
<h2 id="gs_button"><a href="#company_info"><span>Get<br/> Started</span></a></h2>
</div>`enter preformatted text here`
</div>
</section>
<a style="display: inline;" href="#" class="scrollToTop">aaaaaaaaaaaaaaaaaaaaa</a>
</body>
the scrolltoTop is working in firefox and this code is not working in chrome.
Add a comment
|
1 Answer
Just add id="company_info"
in anchor tag <a id="company_info href="#">
. Then it will work smoothly.