当前位置: 代码迷 >> Web前端 >> jQuery展示、隐藏
  详细解决方案

jQuery展示、隐藏

热度:106   发布时间:2012-07-19 16:02:19.0
jQuery显示、隐藏
<%=javascript_include_tag 'jquery'%>
<td  id="note" class="services" >
<input title="显示全部信息"  onclick="<%=jq_show('.all_infos')%><%=jq_hide('.services')%>" type="button" value="显示全部信息">
</td>

<td  id="note" class="all_infos" style="display: none;">
<input title="收起"  onclick="<%=jq_show('.services')%><%=jq_hide('.all_infos')%>" type="button" value="收起">
</td>


   def jq_show(*arg)
      html=""
      arg.each{|a| html+="jQuery('#{a}').show('slow');"}
      html
    end
   
    def jq_hide(*arg)
      html=""
      arg.each{|a| html+="jQuery('#{a}').hide('slow');"}
      html
    end
  相关解决方案