Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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
Jquery 绑定-鼠标悬停在ul列表上_Jquery_Bind_Html Lists - Fatal编程技术网

Jquery 绑定-鼠标悬停在ul列表上

Jquery 绑定-鼠标悬停在ul列表上,jquery,bind,html-lists,Jquery,Bind,Html Lists,我有这样的情况: <ul id="country_list"onmouseover="cl();"> function cl(){ // something to do } 但是这个功能不起作用 对于解决方案,我看到了这个问题,我尝试了所有的建议,但什么都没有 为什么 在题为的问题中,您可以找到函数cl()的所有代码 谢谢您使用mouseover()有什么具体原因吗?我建议: 此外: $('#country_list').hover(function () { //

我有这样的情况:

<ul id="country_list"onmouseover="cl();">

function cl(){ 
// something to do 
}
但是这个功能不起作用

对于解决方案,我看到了这个问题,我尝试了所有的建议,但什么都没有

为什么

在题为的问题中,您可以找到
函数cl()
的所有代码


谢谢

您使用
mouseover()
有什么具体原因吗?我建议:

此外:

$('#country_list').hover(function () {
    // Do something on mouseover
    alert('Cursor landed on the object');
}, function () {
    // Do something on mouseout
    alert('Cursor left the object');
});

旁注:如果这不起作用,那么问题很可能出在其他地方。也许您忘了将jQuery包含在一般内容中,或者某个地方存在一个基本的JS问题。

您想让我们自己找到这个问题吗?拜托,我们是程序员,我们很懒(否则我们会得到一份工作,实际上我们必须做艰苦的劳动;)。更严重的是:你会犯什么错误?“不起作用”有点模糊。它在这里起作用。我打赌这是一个问题,没有使用doc ready函数,脚本在UL标记之上。好的,我已经看到了示例,我会做一个错误,但它对我不起作用。Pheraps用于此…不使用doc ready功能。。。为什么我必须使用它?在哪里?为什么
有效?对不起,用(糟糕的)英语写作对我来说需要很多时间。我没有错误,它没有看到绑定事件。谢谢
$('#country_list').hover(function () {
    // Do something
    alert('Im doing something!');
});
$('#country_list').hover(function () {
    // Do something on mouseover
    alert('Cursor landed on the object');
}, function () {
    // Do something on mouseout
    alert('Cursor left the object');
});