當用戶單擊旋轉木馬內的圖像時,我創建了一個彈出式大圖。我已經達到了這個目標,但圖像位置取決於它在旋轉木馬中的位置。在CSS我現在是:克隆的圖像更改固定分區位置
#carousel1{
width:1000px;
height:200px;
overflow:scroll;
}
#popUp{
display: none;
position: fixed !important;
width: 580px !important;
height: 350px !important;
z-index: 9999;
}
的相關HTML是:
<div id = "carousel1">
<img class="cloudcarousel" src="1.png" alt="1" title="Flag 1 Title" />
<img class="cloudcarousel" src="2.png" alt="2" title="Flag 2 Title" />
<img class="cloudcarousel" src="3.png" alt="3" title="Flag 3 Title" />
<img class="cloudcarousel" src="4.png" alt="4" title="Flag 4 Title" />
<img class="cloudcarousel" src="5.png" alt="5" title="Flag 5 Title" />
</div>
<div id = "popUp"></div>
的相關jQuery是:
this.imagePop = function() {
if (options.imagePop !== 'no') {
$(container).bind('click', this, function (event) {
clearInterval(event.data.autoRotateTimer); // Stop auto rotation if mouse over.
clearInterval(event.data.intervalLeft);
clearInterval(event.data.intervalRight);
var text = $(event.target).attr('alt');
// If we have moved over a carousel item, then show the alt and title text.
var $img = $(event.target);
$('#popUp').html($img.clone().height(200).width(300)).add($('#overLay')).fadeIn();
$('#popUp').add($('#overLay')).click(function() {
$('#popUp').add($('#overLay')).fadeOut(function() {
$('#popUp').empty();
});
});
});
};
};
對於這個問題指的工作示例:WWW。 bingetech.com/carousel
是否有可能將popUp div與克隆圖像置於屏幕中間?
希望你注意到我的編輯,下次只提出你的問題什麼是相關的答案。無用的PHP或其他東西只是給你的代碼添加噪音,使其很難遵循。記住! :)快樂編碼 –