在下面的代碼中,animate()函式在click()起作用。但是,animate()或pulse()(未注釋時) inmouseenter()也不起作用。該pulse()功能由 Jarrod Overson 提供...
http://jarrodoverson.com/static/demos/jquery.pulse.html
sectionTitle = $j(this).find(".sectionTitle");
sectionTitle.click(function(){
if($j(this).parent().height() == sections[$j(this).parent().attr("id")]["height"]){
origHeight = sections[$j(this).parent().attr("id")]["origHeight"];
$j(this).parent().animate({height:origHeight},"slow");
}else{
height = sections[$j(this).parent().attr("id")]["height"];
$j(this).parent().animate({height:height},"slow");
}
})
sectionTitle.mouseenter(function(){
var properties = { "color" : '#F00' };
// $j(this).pulse(properties, 500, 3);
$j(this).animate({"background-color":'#F00'},"slow");
})
我的代碼的一個活生生的例子是here。 http://fantasticvisions.net/test/me/
這些類sectionTitle應用于上述頁面上的許多 H2 元素。單擊它們將導致內容擴展,使用 jQuery animate()。然而,mouseenter()失敗了。
我在這里想念什么?我已經嘗試了許多其他變體,但都沒有奏效。該mouseenter()事件確實觸發了,并且代碼被執行(我已經跟蹤了這個),但效果似乎從未發生過。
uj5u.com熱心網友回復:
.animate()不起作用,因為 jQuery 本身不支持顏色影片。
如果您包含 jQuery UI 或彩色影片插件,這應該可以作業。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/531321.html
標籤:javascriptjQueryjquery-动画脉冲
上一篇:脈動振動器有問題
