我有一張桌子,其中有50張圖像(10x5)全部都是淡色的,當我將鼠標懸停在圖像上時,它會使照亮的亮起來。 我正在努力的是懸停在圖像上,桌面上有多個圖像也很突出。 (我想脫穎而出的相關圖片在表格中是隨機的)。如何將鼠標懸停在圖像上但改變表格中的多個圖像
我到目前爲止的腳本是這樣的;
<script type="text/javascript">
$(function() {
$('.imgOpa').each(function() {
$(this).hover(
function() {
$(this).stop().animate({ opacity: 1.0 }, 800);
},
function() {
$(this).stop().animate({ opacity: 0.5 }, 800);
})
});
});
</script>
如果我能得到任何好的建議,即使它告訴我它是不可能的!
其他人是真正的「隨機」還是他們以某種方式與當前元素被關聯在一起?它們是否存儲在某個數據結構中,您可以在$(this)進行盤旋時訪問它們? – veeTrain