1
<div id="mainContent">
<div class="photoShow"></div>
<div class="photo_nav"></div>
<div class="photo_caption">
<div class="photo_caption_content"></div>
</div>
// .photo_content has jQuery content and photo background
<div id="content">
<div class="photo_content"></div>
<div class="photo_content"></div>
<div class="photo_content"></div>
</div>
<script>
$('.photo_nav a.photo_nav_item').click(function(){
var navClicked = $(this).index();
var Photo = $('.photo_content').get(navClicked);
var curPhoto = $(Photo).html();
$(".photo_nav a.photo_nav_item").removeClass('current');
$(".photoShow").removeClass('current');
$(this).addClass('selected');
$(".photoShow").fadeIn('slow', 'swing');
$(".photoShow").html(curPhoto);
});
</script>
// .photo_content has jQuery properties which runs fine by itself. But with this click //function, it loses the properties. Using .get, instead of .html i.e.
$(".photoShow").get(Photo);
//keeps the contents working but then I lose navigation index property.
//in conclusion, with .html, it displays correct .photo_content but DOM does not work.
//With .get, I get .photo_content that works but indexing does not work.
你的问题不明确。请尝试更好地描述您的问题。 –