我看了一下,但還沒有找到我要找的東西。我可以在燈箱內放置燈箱或圖像映射嗎?
基本上,我在頁面上有一張圖片,它使用jquery lightbox來使它更大,更容易查看。除此之外,在原始燈箱處於活動狀態的情況下,我現在需要在該圖像上的「熱點」,這些熱點或者在懸停時生成工具提示,或者單擊時單獨放置相對定位的燈箱。
如果您點擊自行車並轉到產品頁面,則可以在創建自行車網站上看到我所追求的外觀類型。
一直在玩,但不能爲我的生活工作 - 有誰知道這是甚至可能或能夠指向我的方向已經有這樣的東西實現了嗎?
編輯:
好,所建議的,我已經把一些現有的代碼在這裏,我希望幫助。
這段代碼是典型的燈箱與調用腳本的類lightbox-image一起使用的地方。使用的燈箱是Colorbox。
<p>
<a href="images/search-wheel-big.png" title="This is where the title goes"class="lightboxElement lightbox-image" rel="lightbox-image">
<img class="c-right" alt="alt tag here" src="testimonials_files/SearchWheel.png">
</a>
Some text here
</p>
當收藏夾被加載,<DIV>標記,然後出現包括下面,用(當收藏夾關閉它再次消失)由彩盒腳本生成的<IMG>標籤:
<div id="lightboxContent" style="float: left; width: 500px; height: 554px;">
<div id="lightboxLoadedContent" style="display: block; width: 500px; overflow: auto; height: 507px;">
<img class="lightboxPhoto" src="images/search-wheel-big.png" style="float: none;">
</div>
<div id="lightboxLoadingOverlay" class="" style="height: 554px; display: none;"></div>
<div id="lightboxLoadingGraphic" class="" style="height: 554px; display: none;"></div>
<div id="lightboxTitle" class="" style="display: block;">This is where the title goes</div>
<div id="lightboxCurrent" class="" style="display: none;"></div>
<div id="lightboxNext" class="" style="display: none;"></div>
<div id="lightboxPrevious" class="" style="display: none;"></div>
<div id="lightboxSlideshow" class="" style="display: none;"></div>
<div id="lightboxClose" class="" style="">close</div>
</div>
我當時以爲我可以只是把一個jQuery命令說是這樣的:
$(".lightboxPhoto").each(function(){
$(this).append("<div class='hotspot'></div>");
});
我希望我可以多次這樣做(對於圖像上的不同「熱點」,可以依次點擊/懸停以獲取更多信息),並在每個<div>
標記中插入相對定位的背景圖像。
但是,在代碼中沒有任何反應,這可能與<div>
標籤本身是由.js
文件生成的事實有關,而不是在我的原始html中?我需要自己編輯.js文件嗎?
編輯2 - 解決方案!
大家好!
所以我只是認爲我會在這裏添加我最後做了什麼,以防別人想要創造相同的效果。
正如Chris所建議的,我使用了與colorbox lightbox一起使用的內聯命令。而不是使用一個提示,雖然,我把從建立自行車網站(見他們的產品網頁)的想法,進入下面的HTML代碼:
<div style="display:none">
<div class="example1">
<div class="example2">This is where the title goes</div>
<div class="example3">
<span class="example4"></span>
<div class="example5">
<h5 class="example6">Header text here</h5>
<p class="example7">Some more text here</p>
</div>
</div>
</div>
</div>
的<span>
標籤和<div>
標籤帶班舉例5兩者有背景圖片。當<div>
標籤的默認狀態爲display:none
時,我希望它在<span>
標籤圖像懸停時更改爲display:block
。我做了這個使用css的後續行:
span.example4:hover + div.example5 { display: block; }
像夢一樣工作!只是要記住,這個CSS將無法在IE6或更低
這是可能的,讓我們看看你到目前爲止。 (點擊[編輯]並添加您的代碼)。你可能想要一個'
嗨Wesley,爲延遲道歉,我現在添加了一些代碼,真的希望這有助於! – Jon
除了沒有在IE6中工作,這也不適用於任何用鍵盤導航的用戶。您剛剛讓屏幕閱讀器用戶完全無法訪問該信息。 – steveax