Jcarousel 不渲染幻灯片

发布于 2025-01-01 18:50:52 字数 3298 浏览 4 评论 0原文

大家好,我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫弦 2025-01-08 18:50:52

因此,在第 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().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文