我正在使用 pixastic 库为图像(表格)添加模糊效果。桌子上的项目也对它们启用了相同的效果(它们具有相同的类并且在具有该类的元素上调用像素模糊效果)。
但是,当鼠标在元素之间移动时,效果会消失一毫秒然后出现,不用说,这看起来很糟糕。
在上表中,模糊像素效果被应用于桌子和桌子上的三件衬衫。当鼠标从一个元素(比如表格)移动到另一个元素时,模糊效果会中断(仅瞬间)。
这是我的代码:
// 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();
});