Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用一个简单的切换功能来下拉菜单,并且我还希望在单击时旋转移动菜单图标图像。这可以在这个函数中完成,还是我需要向图像添加一个新的事件监听器?
jQuery('#mobile-menu-icon').click(function() { jQuery('#mobile-menu').slideToggle('slow', function() { });
是的,您可以...实际上这是正确的方法...完成slidetoggle时调用内部的回调函数slideToggle...
slidetoggle
slideToggle
jQuery('#mobile-menu-icon').click(function() { jQuery('#mobile-menu').slideToggle('slow', function() { //do your rotation here }); });