User Tools

Site Tools


programming:jquery

jQuery Mobile

Slow scrolling href

<script type="text/javascript">$(document).ready(function(){ $("a").on(\'click\', function(event) { if (this.hash !== "") { event.preventDefault(); var hash = this.hash; $(\'html, body\').animate({ scrollTop: $(hash).offset().top }, 500, function(){ window.location.hash = hash; }); } }); });</script>
programming/jquery.txt · Last modified: 2018/02/09 10:10 by Jan Forman