【发布时间】:2015-12-08 15:41:16
【问题描述】:
这在 Firefox 上运行良好,但在 Chrome 或 Safari 上却不行。我有 jQuery .hover 并且工作正常,但是当我将内联 onmouseover / onmouseout 添加到该 div 内的图像时,.hover (.main-description) 不会显示。当我悬停时,它实际上将状态更改为“阻止”,但文本块(.main-description)不会显示。
HTML:
<img src="no-hover.png"
width="250" height="250" title="me"
onmouseover="this.src='hover.png';"
onmouseout="this.src=no-hover.png';">
JS:
$(".feature-main").hover(
function() {
$(this).children(".main-description").show();
},
function() {
$(this).children(".main-description").hide();
}
任何帮助将不胜感激。我是否应该提出不同的解决方案?将 onmouseover / onmouseout 也移动到 JS 中?
You can check out the site at here
谢谢!
【问题讨论】:
标签: javascript jquery html css wordpress