私はWebプログラミングが初めてなので、ご容赦ください。
index.html ファイルに div がありますが、これは empty です。
<div id='menu1' >
</div><!--/.well -->
メニュー項目のクリックに基づいて、div の横に html ファイルをロードします。
$('#menu1').load('gallery.html')
したがって、gallery.html には Twitter ブートストラップ サンプル カルーセルがありますが、ロードされません。ただし、コードを index.html の「menu1」div に直接貼り付けると、すべてが機能しているように見えます。
どんな提案も役に立ちます。
EDIT*** my js [スライダーの読み込みを呼び出す]
$(document).ready(function() {
//$('#menu1').load('home.html')
$("li").click(function(){
// If this isn't already active
if (!$(this).hasClass("active")) {
// Remove the class from anything that is active
$("li.active").removeClass("active");
// And make this active
$(this).addClass("active");
}
});
$('ul li a').live('click', function() {
var clickid = $(this).parent('li').index();
var myid = $(this).attr('id');
$('#menu1').html(" ");
$('#slider').css('display','none');
switch (myid)
{
case "home":
$('#slider').css('display','block');
break;
case "aboutus":
$('#menu1').load('aboutus.html')
break;
case "gallery":
$('#menu1').load('gallery.html')
break;
};
//alert(myid);
//alert(clickid);
});
});
gallery.html の EDIT** html コード [私が話しているスライダー]
<div id = "myCarousel" class="carousel">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<img src="../photos/1.jpg" alt="">
<div class="carousel-caption">
<h4>Super sweet bathroom</h4>
<p>This bathroom is truly incredible</p>
</div>
</div>
<div class="item">
<img src="../photos/2.jpg" alt="">
<div class="carousel-caption">
<h4>OK, maybe this bathroom is better</h4>
<p>This beautiful bathroom could be yours - just call Price Builders today.</p>
</div>
</div>
<div class="item">
<img src="../photos/3.jpg" alt="">
<div class="carousel-caption">
<h4>Not even sure what this is</h4>
<p>Go figure</p>
</div>
</div>
</div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div>
gallery.html の画像スライダーが読み込まれますが、機能しません。