;(function ($) { var collapseObj = function () { this.panelTitleClick(); // panel-title 单击 }; collapseObj.prototype = { constructor: collapseObj, /** panel-title 单击 **/ panelTitleClick: function () { $('#collapse').on('click', '.panel-title', _.throttle(this.switchDetail, 300, {'trailing': false})); }, /** 将本panel下的panel-detail显示出来 **/ switchDetail: function () { var $this = $(this), $fa = $this.find('.fa'); if ($fa.hasClass('fa-caret-down')) { $fa.removeClass('fa-caret-down').addClass('fa-caret-up'); } else if ($fa.hasClass('fa-caret-up')) { $fa.removeClass('fa-caret-up').addClass('fa-caret-down'); } $this.siblings('.panel-detail').slideToggle() .parent().siblings('.panel') .find('.panel-detail').slideUp() .parent().find('.panel-title .fa').removeClass('fa-caret-up').addClass('fa-caret-down'); } }; collapseObj.init = function () { new this(); }; /** 本页对象 **/ var userRegisterObj = function () { this.protocolBtnClick(); // 确认并同意条款 按钮单击 }; userRegisterObj.prototype = { constructor: userRegisterObj, /** 确认并同意条款 按钮单击 **/ protocolBtnClick: function () { $(document).on('click', '#protocolBtn', _.throttle(this.switchRegister, 100, {'trailing': false})); }, /** 切换到信息填写 **/ switchRegister: function () { $('#protocolContent').hide(); $('#navTabs').find('.protocolJS').removeClass('active').siblings('.registerJS').addClass('active'); $('#registerContent').show(); } }; userRegisterObj.init = function () { new this(); }; function downInit() { collapseObj.init(); userRegisterObj.init(); /*laydate.render({ elem: '#birthday' });*/ $("#collapse").niceScroll({cursorcolor: "#8a6d3b",}); } $(document).ready = downInit(); })(jQuery);