3
<script type="text/javascript">
$(function() { 
jQuery(".attachment-thumbnail")
.pixastic("desaturate")
.pixastic("sepia")
});
</script>

我得到了这个 pixastic 脚本,现在我需要恢复翻转的效果。我真的不知道该怎么做。如果您想看一下,链接在这里,http ://mentor.com.tr/wp/?page_id=218

4

3 回答 3

4
jQuery(".attachment-thumbnail").live({
  mouseenter: function() {       
     Pixastic.revert(this);

  },
  mouseleave: function() {
    jQuery(this).pixastic("desaturate");
  }
});

请注意,sepia不会做任何与desaturate

该插件没有很好的文档记录,因此我建议将来查看源代码,在此示例line 403中显示

revert : function(img) {
于 2011-07-16T05:48:25.150 回答
0
$(window).load(function () {
    $(".thumb").pixastic('desaturate');
    $(".thumb").live({
        mouseenter: function() {
            Pixastic.revert(this);

        },
        mouseleave: function() {
            $(this).pixastic("desaturate");
        }
    });
})
于 2012-12-26T09:52:31.270 回答
0

大家好,如果您直接在图像上设置悬停事件,上面所说的一切都很好。而在我的情况下,如果我将鼠标悬停在图像容器上(其中还包含其他 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]);

    });
});
于 2014-02-07T15:04:05.110 回答