我想滑动背景。 我在HTML网页中使用了下面的代码一次,它正常工作。 但是,当我试图在我的ASPX页面中使用它时,首先给出了这个错误: “Microsoft JScript运行时错误:'$'未声明” 所以我删除了第一个$ before函数()。但我无法让它继续工作。 任何想法,为什么它不工作? 代码是:Asp.Net和JavaScript:图片幻灯片
<head runat="server">
<title></title>
<script type="text/javascript">
$(function() {
$("#vertical div a").hover(function() {
$("img", this).stop().animate({ top: "-173px" }, { queue: false, duration: 400 });
}, function() {
$("img", this).stop().animate({ top: "0px" }, { queue: false, duration: 400 });
});
});
</script>
<style type="text/css">
.altikisilik
{
display: block;
background: url('Images/Default/Brazil_bg.png') top;
}
#vertical div
{
position: relative;
overflow: hidden;
}
#vertical img
{
position: absolute;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="vertical" class="clear" runat="server">
<div>
<a class="altikisilik" href="Default.aspx">
<img src="Images/Default/Brazil.png" border="0" alt="Brazil" />
</a>
</div>
</div>
</form>
</body>
我知道这是一个真正的愚蠢点,但我并不期望自己是愚蠢的。对不起,谢谢你的回答。现在有一个行动。 – kubilay
其容易犯的错误;) – Atzoya