为什么无法调用jquery?也引用了包了但是没有效果啊?!!
我的程序是:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/x...
我的程序是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Template Name</title>
<!-- Include jQuery Library -->
<script type="text/javascript" src="js/jquery-1.2.2.pack.js"></script>
<!-- Let's do the animation -->
<script type="text/javascript">
$(function() {
// set opacity to nill on page load
$("ul#menu span").css("opacity","0");
// on mouse over
$("ul#menu span").hover(function () {
// animate opacity to full
$(this).stop().animate({
opacity: 1
}, 'slow');
},
// on mouse out
function () {
// animate opacity to nill
$(this).stop().animate({
opacity: 0
}, 'slow');
});
});
</script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easySlider1.5.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#slider").easySlider({
auto: true,
continuous: true
});
});
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div id="wrapper">
<div id="header">
<div id="nav"> <ul id="menu">
<li><a href="index.html" class="home"><span></span></a></li>
<li><a href="about.html" class="about"><span></span></a></li>
<li><a href="work.html" class="work"><span></span></a></li>
<li><a href="blog.html" class="blog"><span></span></a></li>
<li><a href="contact.html" class="contact"><span></span></a></li>
<li><a href="services.html" class="services"><span></span></a></li>
<li><a href="freebies.html" class="freebies"><span></span></a></li>
</ul></div>
</div>
<div id="content">
<div id="welcome"><img src="images/aboutme.gif" alt="" width="228" height="37" border="0" /></div>
<div id="aboutbox">
<div id="aboutext">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis at lorem eget justo semper gravida. Nulla accumsan ultrices enim. In vel leo in lectus bibendum laoreet. Etiam at sapien. Quisque eleifend mi quis ante. Vestibulum molestie, urna lobortis fringilla hendrerit, purus eros malesuadue tellus. Phasellus facilisis.
<br />
<br />
Sem sapien vel felis. Aliquam vulputate rutrum lorem. Suspendisse potenti. Mauris placerat leo sit amet tortor. Nunc eu massa. </div>
</div>
</div>
<div id="footer">Copyright © your website.com. All rights reserved.</div>
</div>
</form>
</body>
</html> 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Template Name</title>
<!-- Include jQuery Library -->
<script type="text/javascript" src="js/jquery-1.2.2.pack.js"></script>
<!-- Let's do the animation -->
<script type="text/javascript">
$(function() {
// set opacity to nill on page load
$("ul#menu span").css("opacity","0");
// on mouse over
$("ul#menu span").hover(function () {
// animate opacity to full
$(this).stop().animate({
opacity: 1
}, 'slow');
},
// on mouse out
function () {
// animate opacity to nill
$(this).stop().animate({
opacity: 0
}, 'slow');
});
});
</script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easySlider1.5.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#slider").easySlider({
auto: true,
continuous: true
});
});
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<div id="wrapper">
<div id="header">
<div id="nav"> <ul id="menu">
<li><a href="index.html" class="home"><span></span></a></li>
<li><a href="about.html" class="about"><span></span></a></li>
<li><a href="work.html" class="work"><span></span></a></li>
<li><a href="blog.html" class="blog"><span></span></a></li>
<li><a href="contact.html" class="contact"><span></span></a></li>
<li><a href="services.html" class="services"><span></span></a></li>
<li><a href="freebies.html" class="freebies"><span></span></a></li>
</ul></div>
</div>
<div id="content">
<div id="welcome"><img src="images/aboutme.gif" alt="" width="228" height="37" border="0" /></div>
<div id="aboutbox">
<div id="aboutext">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis at lorem eget justo semper gravida. Nulla accumsan ultrices enim. In vel leo in lectus bibendum laoreet. Etiam at sapien. Quisque eleifend mi quis ante. Vestibulum molestie, urna lobortis fringilla hendrerit, purus eros malesuadue tellus. Phasellus facilisis.
<br />
<br />
Sem sapien vel felis. Aliquam vulputate rutrum lorem. Suspendisse potenti. Mauris placerat leo sit amet tortor. Nunc eu massa. </div>
</div>
</div>
<div id="footer">Copyright © your website.com. All rights reserved.</div>
</div>
</form>
</body>
</html> 展开
4个回答
展开全部
你的文件引入了两个jquery包
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.js"></script>
可能是发生了冲突吧。
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.js"></script>
可能是发生了冲突吧。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-04-05
展开全部
检查一下载入jquery-1.2.2.pack.js的路径是否正确
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
嗯,1楼兄说的对呀。把导入的链接放前面,脚本再写再后面。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询