如何还原像素效果

How to revert the pixastic effect?

本文关键字:像素 还原 何还原      更新时间:2023-09-26
<script type="text/javascript">
$(function() { 
jQuery(".attachment-thumbnail")
.pixastic("desaturate")
.pixastic("sepia")
});
</script>

我得到了这个像素脚本工作,现在我需要恢复滚动的效果。但我真的不知道该怎么做。链接在这里,如果你想看,http://mentor.com.tr/wp/?page_id=218

jQuery(".attachment-thumbnail").live({
  mouseenter: function() {       
     Pixastic.revert(this);
  },
  mouseleave: function() {
    jQuery(this).pixastic("desaturate");
  }
});

注意sepia不会与desaturate结合做任何事情

这个插件没有很好的文档,所以在将来我建议看一下源代码,在这个例子中line 403显示

revert : function(img) {
$(window).load(function () {
    $(".thumb").pixastic('desaturate');
    $(".thumb").live({
        mouseenter: function() {
            Pixastic.revert(this);
        },
        mouseleave: function() {
            $(this).pixastic("desaturate");
        }
    });
})

嗨,伙计们,如果你直接在图像上设置悬停事件,上面所说的一切都很好。而在我的情况下,我希望图像模糊,如果我悬停在图像容器(其中包含其他div,而不仅仅是图像)。

下面是我的代码,以防其他人正在处理类似的事情:

$(function () {
    $('.col1.w1').mouseenter(function () {
        var origImg = ($(this).find('.imageUrl'));
        if (origImg.is('img')) {
            Pixastic.process(origImg[0], 'blurfast', { amount: 2 });
        }
    });
    $('.col1.w1').mouseout(function () {
        var origImg = ($(this).find('.imageUrl'));
        Pixastic.revert($(this).find('.imageUrl')[0]);
    });
});