第一次在这里发帖,如果有任何标记问题,请原谅我。我不太习惯SOF框架写帖子。
我正在尝试让一些社交图标在悬停时在我的网站上弹出。我从 jQuery UI 中获取了代码来测试它并进行了一些小的编辑,但是我遇到了页面上可见双图像的问题。当鼠标悬停在图像上时,它会弹起,但从弹起图像后面可以看到重复的图像。如果我在弹跳 session 期间将鼠标移开并快速将鼠标悬停在图标上,它会正确弹跳并将图像隐藏在后面。
那么我怎样才能强制它始终将图像隐藏在后面呢?
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<style type="text/css">
div { width: 32px; height: 32px; background-repeat:no-repeat; background-image: url(http://www.liquidclubs.com/assets/img/icon-fb.png); border: position: relative; }
</style>
<script>
$(document).ready(function() {
$("div").mouseenter(function () {
$(this).effect("bounce", { times:3 }, 350);
});
});
</script>
</head>
<br><br><div></div>
</body>
</html>
最佳答案
因为您将图像定义为背景图像。
<div> <img src="http://www.liquidclubs.com/assets/img/icon-fb.png" /></div>
div {
width: 32px;
height: 32px;
}
关于javascript - jQuery UI 弹跳(双图像),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15595656/