我如何才能在div上执行动作,当我有同一个类的多个div [英] How can i execute the action only on the div,when i have multiple div with same class

查看:78
本文介绍了我如何才能在div上执行动作,当我有同一个类的多个div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能在div上执行这个动作,当我有同一个类的多个div时

http://jsfiddle.net/kent93/Qw7bw/



当鼠标输入一个div时,其他div也会有动作,我该如何解决这个问题

我只想要我的鼠标进行动作的div,而不是其他的,最好的解决方案是什么?

$(this).children(。class)


解决方案

/ code>



例如代码 $(。fromTopToBottom)将变为 $(this).children(。fromTopToBottom)



演示: http://jsfiddle.net/Qw7bw/10/


How can i execute the action only on the div,when i have multiple div with same class

http://jsfiddle.net/kent93/Qw7bw/

when the mouse enter one div , the other div also will have action , how can i solve this

i want only the div that my mouse goes in take action , not the other, what best solution?

解决方案

Change the selector of each position to: $(this).children(".class")

for example the code $(".fromTopToBottom") will change to $(this).children(".fromTopToBottom")

Demo: http://jsfiddle.net/Qw7bw/10/

这篇关于我如何才能在div上执行动作,当我有同一个类的多个div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆