2010-08-06 57 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