jquery - Bootstrap smooth scrolling to Anchor - jScript not working -
i'm using twitters bootstrap, want have smooth scrolling anchors, won't work. @ end of document, jut before </body>
tag:
<script type="text/javascript"> !function ($) { $(function(){ $('#running-box, #bg-car').carousel({}); var $root = $('html, body'); $('a').click(function() { var href = $.attr(this, 'href'); $root.animate({ scrolltop: $(href).offset().top }, 500, function () { window.location.hash = href; }); return false; }); }) }(window.jquery) </script>
jquery , bootstrap included correctly...
if replace
'a[href*=#]:not([href=#])'
with
'a[href*=#]:not([href=#]):not([href=#idname])'
you can prevent smooth scrolling working 1 specific link,
Comments
Post a Comment