'use strict'; var publicFun = { init: function init() { this.tab(); this.PublicationShow(); }, // 简易选项卡 tab: function tab() { $('.tab').each(function () { var _this = $(this); _this.find('.hd>a').on('click', function () { var i = $(this).index(); $(this).addClass('on').siblings().removeClass('on'); var c = _this.find('.bd .c').eq(i); c.addClass('on').siblings().removeClass('on'); }); }); }, PublicationShow: function PublicationShow() { $('.PublicationShow').find('.btn').find('a').click(function () { if ($(this).html() == "更多内容") { $(this).html("隐藏内容"); $('.PublicationShow').find('.content').show(); } else { $(this).html("更多内容"); $('.PublicationShow').find('.content').hide(); } }); }, }; $(function () { publicFun.init(); });