編集:ページの下部にあるjQueryリンクの1つを取り出して、スクロールを機能させました
ただし、現在、アコーディオンの折りたたみは機能せず、すべてのリンクが展開されます。
私はこれを取り出しました:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
jQuery プラグインに問題があり、アンカー リンクまでゆっくりとスクロールします。アコーディオンの崩壊を修正するまで、以前は機能していました。私はいたるところを見てきましたが、私はjQueryの初心者であり、正しいファイルをリンクしているかどうか疑問に思っていますか?
goToByScroll プラグインの HTML コードが問題ないことはわかっていますが、それは単なる jQuery リンクまたは jQuery コードだと思います。jQuery のスクロール効果については、http://www.spydertrap.com/blog/2012/08/user-experience-jquery-smooth-page-anchor-transitions/を参照しました。
コードは次のとおりです。
私の文書の頭には、次のものがあります。
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Le Styles-->
<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
私は基本的に独学で勉強しようとしているので、jQuery とのリンクについて何か助けが欲しいです。アコーディオンの折りたたみコードは次のとおりです。
<div class="accordion" id="accordion1">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-parent="#accordion1" data-toggle="collapse" href="#panel1">
<h4>Piece Title</h4>
</a><!--end link heading-->
</div><!--end accordian heading-->
<div class="accordion-body collapse in" id="panel1">
<div class="accordion-inner">
<p>Here's some text.Here's some text.Here's some text.Here's some text.
</div><!--end inner accordion-->
</div><!--end accordion collapse-->
</div><!--end accordion group-->
</div><!--end accordion complete-->
スクリプトを含む HTML ページの下部は次のとおりです。
<script src="js/bootstrap.min.js"></script>
これは削除され、goToByScroll jQuery は機能しましたが、折りたたみ機能は機能しませんでした: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.js"></script>
<!--calls and pauses carousel from sliding-->
<script type="text/javascript">
$(document).ready(function(){
$('.carousel').carousel();
$('.carousel').carousel('pause');
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$(".collapse").collapse()
});
</script>
<!--eases transitions between anchors-->
<script type="text/javascript">
function goToByScroll(id){
$('html,body').animate({scrollTop: $(id).offset().top},'slow');
}
$(document).ready(function(){
$('.nav a').click(function(){
goToByScroll($(this).attr('href'));
return false;
});
});
</script>
ありがとう!さらに必要なドキュメントがある場合は、お知らせください。