简易滑块 Jquery 插件

发布于 2024-11-01 10:45:46 字数 403 浏览 1 评论 0原文

你好,我正在尝试实现一个有手风琴和滑块的网站。

它的工作原理是这样的。第一个手风琴组在加载时打开。该视口中的滑块是水平的。

第二组手风琴也是如此 但我无法在同一页面上实现两个滑块。

我正在使用以下插件: http://cssglobe。 com/post/3783/jquery-plugin-easy-image-or-content-slider

http://bakasura.in/delight/

hello there i am trying to implement a website which has accordion and a slider.

It works like this. First accordion set is open on load. The slider in that view port is horizontal.

same thing for the second set of accordion
But am not able to implement tw sliders on the same page.

I am using the following plugin: http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider

http://bakasura.in/delight/

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

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

发布评论

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

评论(1

塔塔猫 2024-11-08 10:45:46

我看到几个问题。首先是您使用的 easySlider 版本错误。看起来您正在使用旧版本而不是较新的 1.7 版本: http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider

您还拥有两者的多个副本页面中的 Accordion 和 easyslider JavaScript 文件:

<script type="text/javascript" src="js/jquery.accordion.js"></script>
<script type="text/javascript" src="js/jquery.accordion.min.js"></script>
<script type="text/javascript" src="js/easySlider.js"></script>
<script type="text/javascript" src="js/easySlider.packed.js"></script>

不需要两者,您需要选择其中之一:

<script type="text/javascript" src="js/jquery.accordion.min.js"></script>
<script type="text/javascript" src="js/easySlider.js"></script>

另一个问题是您有 2 组上一页/下一页按钮,并且它们各自具有相同的 Id 值。您应该创建唯一的 Id 值,然后使用 easyslider 的 prevId 和 nextId 功能来选择正确的值:

关于按钮:

<div class="sub-next"><span id="aboutNextBtn"><a href="javascript:void(0);"><img src="images/control_next.png"></a></span></div>
<div class="sub-prev"><span id="aboutPrevBtn"><a href="javascript:void(0);"><img src="images/control_back.png"></a></span></div>

工作按钮:

<div class="control-prev"> <span id="workNextBtn"><a href="javascript:void(0);"><img src="images/control_prev.gif" width="36" height="30"></a></span></div>
<div class="control-next"><span id="workPrevBtn"><a href="javascript:void(0);"> <img src="images/control_nxt.gif" width="36" height="30"></a></span></div>

新 jQuery 代码:

$("#slider").easySlider({
    prevId: 'aboutPrevBtn',
    nextId: 'aboutNextBtn',
    continuous: true, 
    controlsShow: false
});

$("#workcase").easySlider({
    prevId: 'workNextBtn', 
    nextId: 'workPrevBtn', 
    controlsShow: false
});

请注意,controlsShow 选项如何用于隐藏 easySlider 的默认控件。

I see a couple of issues. The first is that you are using the wrong version of easySlider. It looks like you are using the older version instead of the newer 1.7 version: http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider

You also have multiple copies of both the accordion and easyslider JavaScript file in your page:

<script type="text/javascript" src="js/jquery.accordion.js"></script>
<script type="text/javascript" src="js/jquery.accordion.min.js"></script>
<script type="text/javascript" src="js/easySlider.js"></script>
<script type="text/javascript" src="js/easySlider.packed.js"></script>

There is no need for both, you need to pick one or the other:

<script type="text/javascript" src="js/jquery.accordion.min.js"></script>
<script type="text/javascript" src="js/easySlider.js"></script>

Another problem is that you have 2 sets of prev/next buttons and they each have the same Id value. You should create unique Id values and then use the prevId and nextId features of easyslider to select the correct ones:

About buttons:

<div class="sub-next"><span id="aboutNextBtn"><a href="javascript:void(0);"><img src="images/control_next.png"></a></span></div>
<div class="sub-prev"><span id="aboutPrevBtn"><a href="javascript:void(0);"><img src="images/control_back.png"></a></span></div>

Work buttons:

<div class="control-prev"> <span id="workNextBtn"><a href="javascript:void(0);"><img src="images/control_prev.gif" width="36" height="30"></a></span></div>
<div class="control-next"><span id="workPrevBtn"><a href="javascript:void(0);"> <img src="images/control_nxt.gif" width="36" height="30"></a></span></div>

New jQuery code:

$("#slider").easySlider({
    prevId: 'aboutPrevBtn',
    nextId: 'aboutNextBtn',
    continuous: true, 
    controlsShow: false
});

$("#workcase").easySlider({
    prevId: 'workNextBtn', 
    nextId: 'workPrevBtn', 
    controlsShow: false
});

Notice how the controlsShow option is used to hide the default controls of easySlider.

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