2010-08-06 55 views
0

對於一個調香師的網站,我在貨架上展示了一排九瓶酒。它看起來像一張連續的照片。我將它切成九個無縫切片,每個切片都有自己的表格單元格,並帶有自己的ID。如何製作鼠標懸停效果?希望jquery

我想使用jQuery,因爲我想在側翻以下幾點:

* Bottle blitzes instantaneously bright also triggers short sound file. 
* After a millisecond or two, returns to normal state. 
* Action repeats only if blurred and re-moused over. 
* Effect the same for each of the 9 bottles. 

MOUSEDOWN(點擊)可能不需要的效果,只是針對特定瓶子的頁面到頭版的iframe。我做了9個小時。切片是白色的,但不知道如何編寫具有定時效果的腳本。

Flash?請不要去那裏;它讓我變得堅強。 OTOH,我發現jQuery要優雅。

回答

0
function pause(milis) 
{ 
var date = new Date(); 
var cur_date = null; 

do { cur_date = new Date(); } 
while(cur_date-date < milis); 
} 

功能pause()將允許您延遲效果。

$('.bottle').hover(
    function(){/*blitz and play*/}, //executed when mouse pointer enters the element 
    function(){pause(2); /*deblitz*/})//executed when mouse pointer leaves the element