我想更改轮播之外的 DIV 的内容。
当您单击轮播 DIV 时,它会从其隐藏的 DIV 中获取内容,并替换轮播之外的其他 DIV 中的内容。我是一些创建这样的东西的东西,看看标题和描述在选择时是如何变化的。http://bqworks.com/products/3d-carousel/example2.html
HTML
<div class="carousel"> <!-- BEGIN CONTAINER -->
<div class="slides"> <!-- BEGIN CAROUSEL -->
<div class="slideItem">
<a href="#">
<img src="images/cars/orange.png" />
</a>
<p class="title">The HEAD 1</p>
<p class="description">Some big big paragraph 1</p>
</div>
<div class="slideItem">
<a href="#">
<img src="images/cars/covered.png" />
</a>
<p class="title">The HEAD 2</p>
<p class="description">Some big big paragraph 2</p>
</div>
<div class="slideItem">
<a href="#">
<img src="images/cars/orange.png" />
</a>
<p class="title">The HEAD 3</p>
<p class="description">Some big big paragraph 3</p>
</div>
</div> <!-- END SLIDES -->
</div><!-- carousel END -->
<div id="text">
<p id="selected-title">THIS SHOULD GET TITLE FROM ABOVE</p>
<p id="selected-description">Description of the selected item</p>
</div>
jQuery
$(document).ready(function(){
$(".slideItem").click(function() {
var title = $('.title').html();
var desc = $('.description').html();
$('#text #selected-title').html.replace(title);
$('#text #selected-description').html.replace(desc);
});
});