jquery简单插件到复杂插件(2)--简单手风琴
手风琴就是展示与隐藏
<div id="dataContent"> <div class="dataLeft fl"> <div id="accordion"> <p class="accordionP">数据展示</p> <ul > <li class="accordionOne aY">实况预报 <ul class="accordioTwo" > <li><a href="">三小时预报</a></li> <li><a href="">五小时预报</a></li> <li><a href="">七小时预报</a></li> <li><a href="">十小时预报</a></li> </ul> </li> <li class="accordionOne aW"> <a href="">格点预报</a> </li> <li class="accordionOne aW"> <a href="">站点数据</a> </li> </ul> </div> </div>
//手风琴js $(function(){ $('.accordionOne').on('click',function(e){ $(this).children().toggle(500); }); });