Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.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
Javascript jQuery UI反弹(双图像)_Javascript_Jquery_Css_User Interface_Bounce - Fatal编程技术网

Javascript jQuery UI反弹(双图像)

Javascript jQuery UI反弹(双图像),javascript,jquery,css,user-interface,bounce,Javascript,Jquery,Css,User Interface,Bounce,第一次在这里发布,所以请原谅我,如果我有任何标记问题。我不习惯用软件框架写文章 我正试图让一些社交图标在我的网站上弹出。我从jQueryUI抓取代码进行测试,并做了一些小的编辑,但是我遇到了一个问题,页面上出现了两个可见的图像。当鼠标悬停在图像上时,它会反弹,但从反弹图像的后面可以看到一个副本。如果我在弹跳会话期间将鼠标移开,并快速将鼠标悬停在图标上,它会正确弹跳,并将图像隐藏在后面 那么,我如何强制它始终隐藏图像 <!DOCTYPE html> <html> <h

第一次在这里发布,所以请原谅我,如果我有任何标记问题。我不习惯用软件框架写文章

我正试图让一些社交图标在我的网站上弹出。我从jQueryUI抓取代码进行测试,并做了一些小的编辑,但是我遇到了一个问题,页面上出现了两个可见的图像。当鼠标悬停在图像上时,它会反弹,但从反弹图像的后面可以看到一个副本。如果我在弹跳会话期间将鼠标移开,并快速将鼠标悬停在图标上,它会正确弹跳,并将图像隐藏在后面

那么,我如何强制它始终隐藏图像

<!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{宽度:32px;高度:32px;背景重复:无重复;背景图像:url(http://www.liquidclubs.com/assets/img/icon-fb.png);边框:位置:相对;}
$(文档).ready(函数(){
$(“div”).mouseenter(函数(){
$(this).effect(“反弹”{times:3},350);
});
});



因为您将图像定义为背景图像


div{
宽度:32px;
高度:32px;
}

第一个问题做得很好:)。您可能还想设置一个,但这不是必需的。
<div> <img src="http://www.liquidclubs.com/assets/img/icon-fb.png" /></div>

div {
    width: 32px;
    height: 32px;
}