您的位置:首页 > 其它

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"));})();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: