Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress存档-如何为jquery动画处理一个类的一个元素?_Jquery_Wordpress_This - Fatal编程技术网

Wordpress存档-如何为jquery动画处理一个类的一个元素?

Wordpress存档-如何为jquery动画处理一个类的一个元素?,jquery,wordpress,this,Jquery,Wordpress,This,我在wordpress网站上有一个简单的动画角落。这在头版效果很好,但在一个页面上,所有元素上都会出现相同的动画,而不仅仅是当前元素。代码是: //animacja zagiętych rogów $(".pad-fix", this).hover(function() { console.log('ok'); $(this).find('.hand').animate({ borderWidth:

我在wordpress网站上有一个简单的动画角落。这在头版效果很好,但在一个页面上,所有元素上都会出现相同的动画,而不仅仅是当前元素。代码是:

//animacja zagiętych rogów
        $(".pad-fix", this).hover(function() {
            console.log('ok');
            $(this).find('.hand').animate({
                borderWidth: "12.5px"
            }, 400);
            $(this).find('.wiecej').animate({
                right: "27px"
            }, 400);
        }, function() {

            $(this).find('.hand').animate({
                borderWidth: "7.5px"
            }, 400);
            $(this).find('.wiecej').animate({
                right: "22px"
            }, 400);
        });

如何将动画缩减为一个。

当您将鼠标悬停在一篇文章上时,会触发
.pad fix
元素上的
hover
事件,该元素似乎是页面上所有文章的父元素。这基本上意味着事件处理程序上下文中的
$(This)=$('.pad fix')
。因此,脚本试图在
.pad fix
中查找所有
.hand
元素,而不是在悬停的single
.pad fix article
中。尝试将您的
悬停
事件绑定到
.pad fix文章
.pad fix.dl\u lead