我希望能夠一次選擇一個盒子,並在盤旋時顯示一個彈出框,但它們具有相同的div類名,每當我懸停時,所有其他盒子彈出以及。在動態div上一次選擇一個div
<div class="parent"> //select one at a time when hovered here
<a href="#" class="show">show content1</a>
</div>
<div class="parent">
<a href="#" class="show">show content2</a>
</div>
<div class="hidden">show this text one at a time when hovered</div>
我試過。對jQuery的使用,因爲它不綁定到一個單一的元素,.toggle,但它不工作,它會顯示所有在同一時間。
我不明白你的要求。你一次一個意思是什麼?或全部在同一時間。起初我以爲這是一條消息,但由於它的信息相同,我沒有得到你需要的東西 – jstuartmilne
每個隱藏的消息都會有所不同,因爲它們將被動態創建,但在本例中,我只是將它作爲一個靜態消息 – evelyn
Check我的答案。那是你要的嗎? – jstuartmilne