首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何定位名为tabSlideOut的jquery滑块

如何定位名为tabSlideOut的jquery滑块
EN

Stack Overflow用户
提问于 2011-08-12 10:57:57
回答 1查看 1.4K关注 0票数 0

我使用jquery tabSlideOut滑块,它运行得很好,但是我需要将它放在页面的任何位置,但是没有这种类型的工具。只有一个属性可用,如tabLocation:“左”

代码语言:javascript
复制
$(function () {
       $('.slide-out-div').show();
       $('.slide-out-div').tabSlideOut({
           tabHandle: '.handle',                     //class of the element that will become your tab
           pathToTabImage: 'Images/feed_back.png', //path to the image for the tab //Optionally can be set using css
           imageHeight: '122px',                     //height of tab image           //Optionally can be set using css
           imageWidth: '40px',                       //width of tab image            //Optionally can be set using css
           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/ use if tabLocation is left or right
           leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
           fixedPosition: false,
           onLoadSlideOut: false                                          //options: true makes it stick(fixed position) on scroll
       });
   });

但是表的值是固定的。因此,请指导我需要更改的代码,以定位tabSlideOut滑块根据我的要求。请帮我处理密码。谢谢

EN

回答 1

Stack Overflow用户

发布于 2012-03-02 04:17:27

您可以使用属性"tabLocation“选择选项卡的固定位置。

  • 值:“顶部”、“左”、“右”、“底部”

然后,您可以使用属性"leftPos“( tabLocation是”底部“或"top")或"topPos”(当tabLocation是“左”或“右”)来定位它。

例如,如果您想将选项卡放在页面的右边,200 of位于"top“下面,则需要使用:

代码语言:javascript
复制
$(function () {
   $('.slide-out-div').tabSlideOut({
       tabLocation: 'right',
       topPos: '200px',
   });

});

选项卡必须固定在页面边框上,并且可以很好地设置这两个属性。如果你想把它定位到任何地方,你需要使用其他插件,或者做一些CSS技巧(比如设置负边距)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7039125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档