jquery滑块和鼠标悬停代码

jquery滑块和鼠标悬停代码,jquery,html,css,Jquery,Html,Css,全部, 在下面的代码中 <html> <head> <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" /> <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>

全部,

在下面的代码中

<html>
<head>
  <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
  <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>

<script src="http://jqueryui.com/latest/ui/effects.core.js"></script>
<script src="http://jqueryui.com/latest/ui/effects.slide.js"></script>
<style type="text/css">
  #show { margin: 0px; width: 100px; height: 80px; background: green; border: 1px solid black; position: relative; }
</style>
</head>
<body>
<div id="details"  onmouseover="javascript:tooltip(this);">keyword</div>
<div id="show" style="display:none;"></div>
</body>

<script>
function tooltip(el)
{
    $("#details").mouseover(function() {
    $("#show").show("slide", {}, 1000);
    });
}
</script>
</html>

#显示{边距:0px;宽度:100px;高度:80px;背景:绿色;边框:1px纯黑色;位置:相对;}
关键词
功能工具提示(el)
{
$(“#详细信息”).mouseover(函数(){
$(#show”).show(“幻灯片,{},1000);
});
}
在鼠标移动到关键字div上。绿色网格框应该在鼠标离开时显示。这是如何实现的


谢谢………

问题是mouseover函数中的代码永远不会执行。当mouseover发生时,jQuery用于将函数重新分配给mouseover,而应该执行它

进行以下更改:

  • 从“详细信息”分区中删除onmouseover:
关键字
  • 通过写入方式加载文档时执行tooltop功能:

$(文档).ready(函数(){
{
$(“#详细信息”).mouseover(函数(){
$(#show”).show(“幻灯片,{},1000);
});
}

问题是mouseover函数中的代码永远不会执行。当mouseover发生时,jQuery被用来将函数重新分配给mouseover,而应该执行它

进行以下更改:

  • 从“详细信息”分区中删除onmouseover:
关键字
  • 通过写入方式加载文档时执行tooltop功能:

$(文档).ready(函数(){
{
$(“#详细信息”).mouseover(函数(){
$(#show”).show(“幻灯片,{},1000);
});
}

每次用户将鼠标移到您的元素上时,您都会附加mouseover逻辑。您不需要将此逻辑包装到函数中,在您的情况下就不需要了

$(function(){
  $("#details").mouseover(function(){
    $("#show").show();
  });
});
现在,以下行已过时:

<div id="details" onmouseover="javascript:tooltip(this);">

每次用户将鼠标移到您的元素上时,您都会附加mouseover逻辑。您不需要将此逻辑包装到函数中,在您的情况下就不需要了

$(function(){
  $("#details").mouseover(function(){
    $("#show").show();
  });
});
现在,以下行已过时:

<div id="details" onmouseover="javascript:tooltip(this);">
<div id="details">