0

ページをスムーズにスクロールしようとして問題が発生しています。基本的に、ページの周りに次のようなアンカータグがあります。

<li><a href="#description">Module Description</a></li>
...
<section id=" description ">

そして、私は正常に動作する次のjavascriptを使用していますが、問題は、このスクリプトを使用すると、ブートストラップ3のモーダルおよびその他の機能が壊れて動作しなくなることです

  $('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
    || location.hostname == this.hostname) {

  var target = $(this.hash);
  target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  if (target.length) {
    $('html,body').animate({
      scrollTop: target.offset().top
    }, 1000);
    return false;
  }
}
}); 

このスクリプトの解決策は何か、またはブートストラップ 3 でテストされている他の同様のスクリプトがあるかどうか疑問に思っています ありがとう

4

2 に答える 2