我有一个使用JQuery创建的图像旋转器,但是当它运行时,我收到一条错误消息,指出Microsoft JScript运行时错误:预期的对象。这是我正在使用的代码。
提前致谢!
<!doctype html>
<html>
<head>
<title>JQuery Test</title>
<style type="text/css">
#nav { margin: 20px auto }
#nav a { padding: 4px 6px; margin: 3px; border: 1px solid #ccc; text-align: center; text-decoration: none; background-color: #ddd }
#nav a.activeSlide { color: #c00 }
#nav a:focus { outline: none; }
.slideshow { margin: 20px auto; padding: 0; clear: left; }
.slide { margin: 0; padding: 0 }
.slideshow, .slide { height: 232px; width: 710px; }
.slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; margin: 0 }
</style>
<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="Scripts/Test.js"></script>
<script type="text/javascript">
$j = jQuery.noConflict();
$(document).ready(function () {
$('.slideshow').cycle({
fx: 'scrollLeft',
timeout: 0,
pager: '#nav'
});
});
</script>
</head>
<body>
<div style="margin:auto;text-align:center"><div id="nav"></div></div>
<div class="slideshow">
<div class="slide">
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
</div>
<div class="slide">
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
</div>
<div class="slide">
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
<img src="Images/Get Inspired/ThumbNails/Th.png" width="200" height="200" />
</div>
</div>
</body>
</html>
答案 0 :(得分:0)
它对我有用,只需删除以下内容:
$j = jQuery.noConflict();
希望它有所帮助...