js代码
<script src='js/stopExecutionOnTimeout.js?t=1'></script> <script src="js/jquery-2.1.1.min.js" type="text/javascript"></script> <script> $(document).ready(function () { var $demo = $('.demo'); var menuTextAT = 500; $(document).on('click', '.demo__menu-btn', function () { $demo.addClass('menu-active'); }); $(document).on('click', '.demo__menu-item', function () { var $item = $(this); var targetSection = $item.data('section'); $item.addClass('clicked'); $demo.removeClass('menu-active'); $('.demo__section.active-section').removeClass('active-section'); $('.demo__section--' + targetSection).addClass('active-section'); setTimeout(function () { $item.removeClass('clicked'); }, menuTextAT); }); }); </script>