Tab切换
2016-05-13 15:44
295 查看
要引入jquery库
//tab切换;(function(){function Tab(){}Tab.prototype={constructor:Tab,init:function($Content,$btn){this.$Content.hide().first().show();this.$btn.removeClass("active").first().addClass("active");this.clickTab();},clickTab:function(){this.$btn.each(function(index){$(this).on("click",function(){$(this).addClass("active").siblings().removeClass("active");$Content.hide().eq(index).show();});});}}var tab=new Tab();tab.init($(".my-Collect-con"),$(".my-Collect-btn").find("a"));})();
相关文章推荐
- 如何建立本地Ubuntu安装源
- nginx location 指令匹配顺序
- 构建高可用、高性能的 GPFS 集群
- xCAT裸机部署
- window system()函数的使用总结
- Android动态添加TextView
- jdbc(RowSet离线结果集)
- Redis主从在线互相切换
- HDU 4502 吉哥系列故事——临时工计划(时间安排的01背包)
- springmvc+spring3+hibernate4框架整合完整版
- TextView设置部分文字可点击及样式
- docxgen生成接口文档的规范
- Android系统上部署webservice
- 文章标题
- 25个iptables常用示例
- Shader实例:一台旧电视
- xCAT2安装配置
- xcat 安装(liunx高性能刀片集群管理软件)
- 从现在起,培养五个获益终生的思维习惯。
- Android广播的基本介绍