Jcarousel 不渲染幻灯片
大家好,我对 jquery 很陌生,请帮助我在我的系统上独立于 jsfiddle 此链接运行应用程序< /a>..我在我的应用程序中添加了以下资源文件,但它仍然没有渲染颜色块..
这是我的代码:
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js" type="text/javascript"></script>
<script src="jquery.mobile.carousel.js" type="text/javascript" language="javascript"></script>
<script src="jquery.ui.ipad.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#carousel1").carousel();
})(jQuery);
</script>
</head>
<body>
<div style="height: 300px; width: 500px">
<ul id="carousel1" style="display: none;">
<li><div style="width: 100%; height: 100%; background-color:#381;">Page 1</div></li>
<li><div style="width: 100%; height: 100%; background-color:#837;">Page 2</div></li>
<li><div style="width: 100%; height: 100%; background-color:#999;">Page 3</div></li>
<li><div style="width: 100%; height: 100%; background-color:#738;">Page 4</div></li>
<li><div style="width: 100%; height: 100%; background-color:#142;">Page 5</div></li>
<li><div style="width: 100%; height: 100%; background-color:#927;">Page 6</div></li>
<li><div style="width: 100%; height: 100%; background-color:#987;">Page 7</div></li>
<li><div style="width: 100%; height: 100%; background-color:#187;">Page 8</div></li>
</ul>
</div>
Vertical
<div style="height: 300px; width: 500px">
<ul id="carousel2" style="display: none;">
<li><div style="width: 100%; height: 100%; background-color:#381;">Page 1</div></li>
<li><div style="width: 100%; height: 100%; background-color:#837;">Page 2</div></li>
<li><div style="width: 100%; height: 100%; background-color:#999;">Page 3</div></li>
<li><div style="width: 100%; height: 100%; background-color:#738;">Page 4</div></li>
<li><div style="width: 100%; height: 100%; background-color:#142;">Page 5</div></li>
<li><div style="width: 100%; height: 100%; background-color:#927;">Page 6</div></li>
<li><div style="width: 100%; height: 100%; background-color:#987;">Page 7</div></li>
<li><div style="width: 100%; height: 100%; background-color:#187;">Page 8</div></li>
</ul>
</div>
</body>
</html>
请帮助...提前致谢...
Hi everyone i am very new to jquery, please help me in running the app on my system independent of jsfiddle this link.. I have added below resource files in my app, but still it is not rendering the colour blocks..
this is my code:
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js" type="text/javascript"></script>
<script src="jquery.mobile.carousel.js" type="text/javascript" language="javascript"></script>
<script src="jquery.ui.ipad.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function($) {
$("#carousel1").carousel();
})(jQuery);
</script>
</head>
<body>
<div style="height: 300px; width: 500px">
<ul id="carousel1" style="display: none;">
<li><div style="width: 100%; height: 100%; background-color:#381;">Page 1</div></li>
<li><div style="width: 100%; height: 100%; background-color:#837;">Page 2</div></li>
<li><div style="width: 100%; height: 100%; background-color:#999;">Page 3</div></li>
<li><div style="width: 100%; height: 100%; background-color:#738;">Page 4</div></li>
<li><div style="width: 100%; height: 100%; background-color:#142;">Page 5</div></li>
<li><div style="width: 100%; height: 100%; background-color:#927;">Page 6</div></li>
<li><div style="width: 100%; height: 100%; background-color:#987;">Page 7</div></li>
<li><div style="width: 100%; height: 100%; background-color:#187;">Page 8</div></li>
</ul>
</div>
Vertical
<div style="height: 300px; width: 500px">
<ul id="carousel2" style="display: none;">
<li><div style="width: 100%; height: 100%; background-color:#381;">Page 1</div></li>
<li><div style="width: 100%; height: 100%; background-color:#837;">Page 2</div></li>
<li><div style="width: 100%; height: 100%; background-color:#999;">Page 3</div></li>
<li><div style="width: 100%; height: 100%; background-color:#738;">Page 4</div></li>
<li><div style="width: 100%; height: 100%; background-color:#142;">Page 5</div></li>
<li><div style="width: 100%; height: 100%; background-color:#927;">Page 6</div></li>
<li><div style="width: 100%; height: 100%; background-color:#987;">Page 7</div></li>
<li><div style="width: 100%; height: 100%; background-color:#187;">Page 8</div></li>
</ul>
</div>
</body>
</html>
please help ... Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,在第 8 行中,您似乎尝试在 DOM 加载后将 #carousel1 设置为 carousel() 。你的 lambda 函数对我来说看起来有点错误。你的 function($) 应该是 function()。
So, it looks like in line 8 you are trying to set #carousel1 as a carousel() once the DOM has loaded. Your lambda function looks slightly wrong to me. Your function($) should be function().