jquery左右滑动的选项卡,tab标签
css代码和js文件在演示页面可以查看源码
本例只放了2个tab,需要更多的话也很方便添加
JavaScript Code
- <script type="text/javascript">
- $(function() {
- var indicator = $('#indicator'),
- indicatorHalfWidth = indicator.width()/2,
- lis = $('#tabs').children('li');
- $("#tabs").tabs("#content section", {
- effect: 'fade',
- fadeOutSpeed: 0,
- fadeInSpeed: 400,
- onBeforeClick: function(event, index) {
- var li = lis.eq(index),
- newPos = li.position().left + (li.width()/2) - indicatorHalfWidth;
- indicator.stop(true).animate({ left: newPos }, 600, 'easeInOutExpo');
- }
- });
- });
- </script>
XML/HTML Code
- <nav>
- <ul id="tabs">
- <li><a class="current" href="#">导航菜单</a></li>
- <li><a href="#">TAB标签</a></li>
- </ul>
- <span id="indicator"></span>
- </nav>
- <div id="content">
- <section>
- <p>各种下拉菜单,导航,多级菜单,右侧展开,左侧展开</p>
- </section>
- <section>
- <p>tab标签,选项卡,选卡,jquery选项卡,标签页</p>
- </section>
- </div>
相关推荐
周公周金桥 2020-09-06
大象从不倒下 2020-07-31
AlisaClass 2020-07-19
MaureenChen 2020-04-21
xingguanghai 2020-03-13
teresalxm 2020-02-18
木四小哥 2013-05-14
SoShellon 2013-06-01
Simagle 2013-05-31
羽化大刀Chrome 2013-05-31
waterv 2020-01-08
LutosX 2013-07-29
vanturman 2013-06-27
wutongyuq 2013-04-12
luoqu 2013-04-10
today0 2020-09-22
89520292 2020-09-18
bigname 2020-08-25