使用jQuery滑出选项卡

编程入门 行业动态 更新时间:2024-10-27 12:31:50
本文介绍了使用jQuery滑出选项卡-需要多个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Tab Slide Out Jquery插件. wpaoli.building58/2009/09/jquery-tab-slide-out-plugin/

I'm using the Tab Slide Out Jquery plugin. wpaoli.building58/2009/09/jquery-tab-slide-out-plugin/

我在左侧显示一个选项卡,但我想在右侧显示另一个独立的选项卡. 当我复制css,js和div的块时,将显示右侧的选项卡,但如果我激活右侧的选项卡,则只能激活左侧的选项卡.

I have one tab that appears on the left, but i wanted another independent tab on the right. When i duplicate the blocks of css, js and the div, the tab on the right appears but i can only activate the one on the left if i activate the one on the right.

联系人图像也仅显示在右侧,因此我只能激活右侧的选项卡. 我该如何编写代码,以便在一页上有多个标签并独立激活它们?

Also the contact image only appears on the right, so i can only activate the right tab. How can i code this so that i can have more than one tab on one page and activate them independently?

$(function(){ $('.slide-out-div').tabSlideOut({ tabHandle: '.handle', //class of the element that will be your tab pathToTabImage: 'images/contact_tab.gif', //path to the image for the tab (optionaly can be set using css) imageHeight: '122px', //height of tab image imageWidth: '40px', //width of tab image tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left speed: 300, //speed of animation action: 'click', //options: 'click' or 'hover', action to trigger animation topPos: '200px', //position from the top fixedPosition: false //options: true makes it stick(fixed position) on scroll }); $('.slide-out-div-apps').tabSlideOut({ tabHandle: '.handle', //class of the element that will be your tab pathToTabImage: 'images/contact_tab.gif', //path to the image for the tab (optionaly can be set using css) imageHeight: '122px', //height of tab image imageWidth: '40px', //width of tab image tabLocation: 'right', //side of screen where tab lives, top, right, bottom, or left speed: 300, //speed of animation action: 'click', //options: 'click' or 'hover', action to trigger animation topPos: '200px', //position from the top fixedPosition: false //options: true makes it stick(fixed position) on scroll }); });

这是我的CSS

.slide-out-div { padding: 20px; width: 250px; background: #f2f2f2; border: #29216d 2px solid; } .slide-out-div-apps { padding: 20px; width: 250px; background: #f2f2f2; border: #29216d 2px solid; }

推荐答案

您的问题是tabHandle:'.handle

Your problem is tabHandle: '.handle

要解决此问题,请为每个.handle添加另一个类,例如,您可以使用.handle.first和.handle.second

To solve this add another class to each .handle so for instance you could have .handle.first and .handle.second

这样,每个触发器都是唯一的.干杯

This way each trigger is unique. Cheers

更多推荐

使用jQuery滑出选项卡

本文发布于:2023-10-08 10:02:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472299.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   滑出   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!