Tab使用jQuery滑出 - 需要不止一个

时间:2011-10-04 09:19:31

标签: jquery

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

我有一个显示在左侧的标签,但我想在右侧显示另一个独立标签。 当我复制css,js和div的块时,右边的选项卡会出现,但如果我激活右边的那个,我只能激活左边的那个。

此外,联系人图片仅显示在右侧,因此我只能激活右侧标签。 我如何对此进行编码,以便我可以在一个页面上有多个选项卡并单独激活它们?

 $(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;
}

1 个答案:

答案 0 :(得分:3)

你的问题是tabHandle:'。handlele

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

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