diff --git a/js/demo.js b/js/demo.js index acb7968..f73609f 100644 --- a/js/demo.js +++ b/js/demo.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-11 09:17:17 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-11 11:53:57 + * @LastEditTime: 2019-12-11 11:55:53 */ $(document).ready(function () { $('#btn').on('click', function () { @@ -52,10 +52,10 @@ $(document).ready(function () { // $('.collpase-icon').remove('icon-shouqi').add('icon-zhankai'); } - if ($(this).hasClass('icon-zhankai')) { - $(this).removeClass('icon-zhankai').addClass('icon-shouqi') + if ($('.collpase-icon').hasClass('icon-zhankai')) { + $('.collpase-icon').removeClass('icon-zhankai').addClass('icon-shouqi') } else { - $(this).removeClass('icon-shouqi').addClass('icon-zhankai') + $('.collpase-icon').removeClass('icon-shouqi').addClass('icon-zhankai') } } // 收缩左侧侧边栏