我正在使用pixastic庫爲圖像(表格)添加模糊效果。桌子上的物品也具有相同的效果(它們具有相同的類別&在具有該類的元素上正在調用pixastic模糊效果)。當鼠標在兩個元素之間移動時鼠標懸停效果會中斷
但是,當鼠標在元素之間移動時,效果消失1毫秒&然後出現,不用說,這看起來很糟糕。
在上表中,模糊像素效果應用於表格上的三件襯衫&。當鼠標從一個元素(比如表格)移動到另一個元素時,模糊效果會中斷(僅一瞬間)。
這裏是我的代碼:
// class .cItemsOnTable is elements which need to be blurred
$(document.body).on("mouseover", ".cItemsOnTable", function (event) {
/* as the blur effect is suppose to simulate eye focus,
I use pixasticRevert func. to revert the blur effect
on other elements when mouse hovers over elements with
class cItemsOnTable */
pixasticRevert();
var modelWearArray = $(".cModelWear");
/* modelWearArray is the other elements which receive blur
effect if mouse is not hovering over class cItemsOnTable */
$(modelWearArray).each(function() {
$(this).addClass("cBlur");
pixasticBlur();
}
}).on("mouseleave", ".cItemsOnTable", function (event) {
pixasticRevert();
var itemsOnTableArray = $(".cItemsOnTable");
$(itemsOnTableArray).each(function() {
$(this).addClass("cBlur");
});
pixasticBlur();
});
你能提供一個實例或至少一些html代碼嗎?你嘗試過「mouseenter」而不是「mouseover」嗎? – ori
@ori,我有。我不能提供現場示例,因爲我懷疑jsfiddle支持pixastic庫 – Kayote