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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -