jQuery 简单的鼠标滑动tab

XML/HTML Code
- <div class="views">
- <div class="view views-nav" id="nav">
- <ul>
- <li><a href="#what" data-pushview>标题1</a></li>
- <li><a href="#how" data-pushview>标题2</a></li>
- <li><a href="#where" data-pushview>标题3</a></li>
- </ul>
- </div>
- <div class="views-main">
- <div class="view" id="what">
- <div class="view-content">
- <h2>内容1</h2>
- <ul class="view-nav clearfix">
- <li class="view-nav-contents pull-left"><a href="#nav" data-popview>Contents</a></li>
- <li class="view-nav-next pull-right"><a href="#how" data-pushview>How it works</a></li>
- </ul>
- </div>
- </div>
- <div class="view" id="how">
- <div class="view-content">
- <h2>内容2</h2>
- <ul class="view-nav clearfix">
- <li class="view-nav-contents pull-left"><a href="#nav" data-popview>Contents</a></li>
- <li class="view-nav-next pull-right"><a href="#where" data-pushview>How it works</a></li>
- </ul>
- </div>
- </div>
- <div class="view" id="where">
- <div class="view-content">
- <h2>内容3</h2>
- <p>www.freejs.net</p>
- <ul class="view-nav clearfix">
- <li class="view-nav-contents pull-left"><a href="#nav" data-popview>Contents</a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- this library removes the 300ms delay on browsers with touch UIs -->
- <script src="vendor/fastclick.js"></script>
- <script>
- // "Zepto is a minimalist JavaScript library for modern browsers with a
- // largely jQuery-compatible API." What this chunk of code does is
- // determine which library to use (jQuery or Zepto), and then which
- // scroll plugin to use. For more info, see http://zeptojs.com/#download
- var useZepto = ('__proto__' in {})
- , lib = useZepto ? 'zepto' : 'jquery'
- , scrollPlugin = useZepto ? 'scroll' : 'scrollTo';
- document.write(
- '<script src=vendor/' + lib + '.min.js></script>' +
- '<script src=vendor/' + lib + '.' + scrollPlugin + '.min.js></script>'
- );
- </script>
- <!-- including the (minified) plugin, because duh -->
- <script src="lib/simpleslideview.min.js"></script>
- <script>
- // Here is a very basic implementation. '.views' will be
- // the view container, any elements therein with a class of
- // 'view' will be a view, and the only default option we're
- // overriding is the duration of the animations.
- $('.views').simpleSlideView({ duration: 250 });
- </script>
原文地址:http://www.freejs.net/article_jquerywenzi_229.html
最近更新
- CSS3鼠标悬停图片遮罩层变形动画特...
- 响应式全屏手风琴菜单,同时支持垂直方...
- 分组select选择器,支持多选和单...
- jQuery时间日期选择器代码日历插...
- Select 选择器 可以清空的单选...
- jQuery json 无刷新翻页 ...
我爱薅羊毛
点击最多
广告赞助
相关文章
- jquery点击显示或隐藏内容,可以一次展开多个和...
- tooltips/弹出层/消息提示效果,支持点击与...
- jQuery幸运大转盘抽奖活动代码
- jquery来实现的添加商品和减少商品数量,用于购...
- jQuery手机端弹出层提示对话框
- php js实现拖动滑块完成拼图验证码