绑定 - 鼠标悬停在 ul 列表上
我遇到这样的情况:
<ul id="country_list"onmouseover="cl();">
function cl(){
// something to do
}
该功能可以运行但没有声音。
所以我这样做:
$('#country_list').bind('mouseover', function () { // do what you want to do on mouse over });
但是功能不起作用!
对于解决方案,我看到了这个问题 My mouseover, mouseleave does not work 我已经尝试过所有的建议,但什么也没有!
为什么???
在名为 变量和 jquery 的问题中:如何捕获值并使用它们(第 3 部分),您可以找到 function cl()
的所有代码。
谢谢
I have this situation:
<ul id="country_list"onmouseover="cl();">
function cl(){
// something to do
}
This function goes but not sounds.
So I do this:
$('#country_list').bind('mouseover', function () { // do what you want to do on mouse over });
but the function doesn't work!!!
For the solution I have seen this question My mouseover, mouseleave doesnt work and I have tried all the suggestions, but nothing !
Why???
In the question called variables and jquery: how capture value and use them (part 3) you can find all my codex for the function cl()
.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用
mouseover()
有什么具体原因吗?我会推荐hover()
:进一步:
A 面注意:如果这不起作用,那么问题很可能出在其他地方。也许您忘记了一般情况下包含 jQuery,或者某个地方存在基本的 JS 问题。
Is there any specific reason you are using
mouseover()
? I would recommendhover()
:Further more:
A side note: If this doesn't work, then most likely the problem is somewhere else. Maybe you forgot to include jQuery in general or there is a fundamental JS issue somewhere.