微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jquery – 空的悬浮事件在IE中未触发

我有一个div里面有一个小孩div。当鼠标悬停在父div上时,我使用jQuery显示/隐藏子div(父div跨越页面的整个底部。宽度:100%和高度100px)。我已经使用firebug和ie开发者工具栏来确认父div在页面上。

我可以将鼠标悬停在Chrome和FireFox的空父父div中,一切正常。 IE要求我有一些内部的文字来悬停。只有一个空白的div悬停事件不会触发。

这个问题的所有可行的工作呢?

–update

试过你的所有建议,但没有任何工作。

<div id="toolBar">          
  <div>
    <button id="btnPin" title="Click to pin toolbar" type="button">
      <img id="pin" src="../../images/icons/unpin.png" alt="Pin" /></button>
      <img src="../../images/icons/search.png" border="0" alt="Search" />
  </div>
</div>

以上html包含在master页面的div容器中。孩子div被jQuery隐藏,有些悬停在/ out事件中。父div(toolBar)始终在页面上可见。当工具栏上出现鼠标悬停时,显示小孩div。

感谢jQuery代码

$('#toolBar').hover(ToolBar_OnHover,ToolBar_OnBlur);

function ToolBar_OnHover() {

  $(this).children().fadeIn('fast');
  $(this).animate({ height: "100px" },"fast");

}

function ToolBar_OnBlur() {

  $(this).children().fadeOut('fast');
  $(this).animate({ height: "50px" },"fast");

}

最后这里有一点css

#toolBar { width: 100%; height: 100px; text-align:center; vertical-align:middle; position: absolute;  bottom: 0; background-color: Transparent;  }
#toolBar div { padding: 5px 5px 0px 5px; width:75%; height: 95px; background: transparent url('/images/toolbar-background.png') repeat-x; margin-right: auto; margin-left: auto; }

解决方法

如果您设置背景颜色或边框,它将工作

如果你能匹配这些与现有的外观,那么你会没事

(背景图像似乎是最不引人注目的解决方案)

原文地址:https://www.jb51.cc/jquery/182324.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐