Twitter Bootstrap 3.1.1에서 작동하도록 간단한 회전 목마를 만들려고합니다. 스타일링없이 간단하게 일반적인 부트 스트랩 마크 업을 제거했지만 아직 이미지를 가져 오는 행운이 없었습니다. 어떤 제안이라도 고맙게 생각합니다. 내 마크 업은 다음과 같습니다.Twitter Bootstrap 회전 목마가 작동하지 않습니다 (3.1.1)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="test/css" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.css">
<style type="text/css">
.container{
margin: 0 auto;
}
</style>
</head>
<body>
<div class="container">
<!-- carousel -->
<div id="this-carousel-id" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<img src="images/sample1.svg" alt="" />
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/sample2.svg" alt="" />
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img src="images/sample3.svg" alt="" />
<div class="carousel-caption">
</div>
</div>
</div>
<!-- .carousel-inner -->
<!-- next and previous controls here
href values must reference the id for this carousel -->
<a class="carousel-control left" href="#this-carousel-id" data-slide="prev">‹</a>
<a class="carousel-control right" href="#this-carousel-id" data-slide="next">›</a>
</div>
<!-- .carousel -->
<!-- end carousel -->
</div><!-- /container -->
<!-- Javascript-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>
<!-- Bootstrap jQuery plugins compiled and minified -->
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('.carousel').carousel({
interval: 4000
});
});
</script>
</body>
</html>
자바 스크립트 코드가 모두 올바르게로드 되었습니까? 상대 경로 인 js/bootstrap.min.js를 가리키고 있습니다. js 디렉토리가 실행중인 페이지와 동일한 레벨입니까? – jaapz
고마워요. 예, 다음과 같이 리디렉션되었습니다. http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js 현재 작동 중입니다. – KPL