点击div实现toggleClass隐藏和出现功能,为什么隐藏后出不来?
$(document).ready(function(){
$('#switcher').click(function(event) {
if(event.target == this){
$('#switcher button').toggleClass('hidden');
}
});
});
<div id="switcher" class="switcher">
<h3>Style Switcher</h3>
<button id="switcher-default">
Default
</button>
<button id="switcher-narrow">
Narrow Column
</button>
<button id="switcher-large">
Large Print
</button>
</div>
长风秋雁
慕田峪4524236
随时随地看视频慕课网APP
相关分类