如何动态使用coin-slider插件?

发布于 2024-10-08 18:12:42 字数 606 浏览 1 评论 0原文

我在我的应用程序中使用了硬币滑块。我的应用程序支持所有分辨率。但是如果我想使用硬币滑块,我必须设置宽度,否则它将采用默认宽度 585。但是根据我的应用程序,我必须设置对于所有分辨率,动态宽度。为此,我使用了 width:auto 属性。如果我使用此属性,硬币滑块将不起作用。我该如何解决此问题?我的代码:

 > function coinSlide(id) {
    >                     id = '#'+id.replace(/:/g, "\\:");
    >                     var sliderWidth="auto";
    >                     alert("Width : "+sliderWidth);
    >                 <%--sliderWidth = 60em;--%>
    >                         jQuery(id).coinslider({width:sliderWidth,height:screen.height/4,delay:500});
    >                     }

请帮助我。

i have used coin slider for my application.My application supported for all resolution .But if i wants to use coin-slider i have to be set width or else it takes its default width 585.But according to my application i have to be set width dynamically for all resolutions.For this i have used width:auto property.If i used this property coin-slider is not working.How can i resolve this issue?My code :

 > function coinSlide(id) {
    >                     id = '#'+id.replace(/:/g, "\\:");
    >                     var sliderWidth="auto";
    >                     alert("Width : "+sliderWidth);
    >                 <%--sliderWidth = 60em;--%>
    >                         jQuery(id).coinslider({width:sliderWidth,height:screen.height/4,delay:500});
    >                     }

Please help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

兮颜 2024-10-15 18:12:42

硬币滑块需要固定高度和固定高度width,因为它从中计算粒子 div。它将图像区域划分为更小的div(这些div位于图像的顶部),并且每个div具有相同的背景图像(新图像),但背景位置不同。一旦计数,动画就会开始。

因此,对于这些位置计数,您必须有固定大小的基础区域。

Coinslider needs fixed height & width, because it counts the particle divs from that. It divides the image area into smaller divs (these divs are on the top of the image), and every div has the same background image (the new image) with different background position. Once it counted, the animation starts.

So for these position countings, you must have fixed size base area.

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