This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。
7年前关闭。
我有一个无法在我的网站上运行的jQuery函数。 Firebug和Chrome的检查器均未报告任何错误。我运行了一个jsfiddle,它在那里工作得很好。关于这个问题有什么想法吗?我很沮丧。
这是我的功能:
7年前关闭。
我有一个无法在我的网站上运行的jQuery函数。 Firebug和Chrome的检查器均未报告任何错误。我运行了一个jsfiddle,它在那里工作得很好。关于这个问题有什么想法吗?我很沮丧。
这是我的功能:
$("#totop").hover(
function(){
$(this).stop().animate({height: "50px"}, "slow");
},
function(){
$(this).stop().animate({height: "20px"}, "slow");
}
);
最佳答案
试试这个,将像魅力一样工作:=)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="author" content=""/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<title></title>
<style type="text/css">
*{margin:0px;padding:0px}
#totop{width:400px;
height:20px;
position: absolute;
bottom: 0px;
left: 35%;width: 30%;
background: #78D3D9;
height: 20px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#totop").hover(
function(){
$(this).stop().animate({height: "50px"}, "slow");
},
function(){
$(this).stop().animate({height: "20px"}, "slow");
}
);
});
</script>
</head>
<body>
<a href="#topofpage"><div id="totop"></div></a>
</body>
</html>
关于jquery - jQuery脚本可以在jsfiddle上运行,但不能在我的网站上运行吗? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13997843/