jQuery實(shí)現(xiàn)table表格信息的展開和縮小功能示例
本文實(shí)例講述了jQuery實(shí)現(xiàn)table表格信息的展開和縮小功能。分享給大家供大家參考,具體如下:
<%@ page language="java"import="java.util.*"pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTDHTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>" rel="external nofollow" > <title>My JSP 'index4.jsp' startingpage</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <link rel="stylesheet" type="text/css" href="css/index9.css" rel="external nofollow" > <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> </head> <body> <table width="200px" height="100px" border="1"> <tr> <td>編號</td> <td>姓名</td> <td>成績</td> </tr> <tr align="left" class="parent" id="row1"><td colspan="3">學(xué)生信息</td></tr> <tr class="child_row1"> <td>001</td> <td>小明</td> <td>80</td> </tr> <tr class="child_row1"> <td>002</td> <td>張三</td> <td>79</td> </tr> </table> <script type="text/javascript"> $(function() { $("tr.parent").click(function() { $(this).toggleClass("selected").siblings('.child_'+this.id).toggle(); }); }); </script> </body> </html>
運(yùn)行效果如下
更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery表格(table)操作技巧匯總》、《jQuery操作json數(shù)據(jù)技巧匯總》、《jQuery form操作技巧匯總》、《jQuery常用插件及用法總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)獲取table表格第一列值的方法
- JQuery Ajax動態(tài)生成Table表格
- jQuery對table表格進(jìn)行增刪改查
- 基于JQuery的動態(tài)刪除Table表格的行和列的代碼
- JQuery 動態(tài)生成Table表格實(shí)例代碼
- 使用jQuery操作HTML的table表格的實(shí)例解析
- jQuery實(shí)現(xiàn)Table表格隔行變色及高亮顯示當(dāng)前選擇行效果示例
- jQuery實(shí)現(xiàn)table表格checkbox全選的方法分析
- jQuery+CSS實(shí)現(xiàn)的table表格行列轉(zhuǎn)置功能示例
- jQuery動態(tài)操作表單示例【基于table表格】
- jQuery實(shí)現(xiàn)為table表格動態(tài)添加或刪除tr功能示例
相關(guān)文章
jQuery實(shí)現(xiàn)ajax調(diào)用WCF服務(wù)的方法(附帶demo下載)
這篇文章主要介紹了jQuery實(shí)現(xiàn)ajax調(diào)用WCF服務(wù)的方法,以完整實(shí)例形式分析了jQuery的ajax前端調(diào)用及后臺交互調(diào)用WCF服務(wù)的相關(guān)技巧,并附帶完整實(shí)例共讀者下載,需要的朋友可以參考下2015-12-12jquery實(shí)現(xiàn)用戶登陸界面(示例講解)
下面小編就為大家?guī)硪黄猨query實(shí)現(xiàn)用戶登陸界面(示例講解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-09-09jquery實(shí)現(xiàn)的用戶注冊表單提示操作效果代碼分享
這篇文章主要介紹了jquery實(shí)現(xiàn)的用戶注冊表單提示操作效果,推薦給大家,有需要的小伙伴可以參考下。2015-08-08Java框架SSH結(jié)合Easyui控件實(shí)現(xiàn)省市縣三級聯(lián)動示例解析
這篇文章主要為大家詳細(xì)介紹了Java框架SSH結(jié)合Easyui控件實(shí)現(xiàn)省市縣三級聯(lián)動示例,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-06-06jQuery實(shí)現(xiàn)美觀的多級動畫效果菜單代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)多級動畫效果菜單代碼,涉及jquery針對頁面元素的遍歷及事件綁定操作頁面元素樣式變換的技巧,界面美觀實(shí)用,具有一定參考借鑒價值,需要的朋友可以參考下2015-09-09一款基jquery超炫的動畫導(dǎo)航菜單可響應(yīng)單擊事件
。這款導(dǎo)航菜單,初始時頁面中間一個按鈕,單擊按鈕,菜單從左側(cè)飛入頁中。再次單擊按鈕,導(dǎo)航飛入左側(cè)消息2014-11-11