SandBox > jQuery

「SandBox/jQuery」の編集履歴(バックアップ)一覧はこちら

SandBox/jQuery」(2010/02/14 (日) 04:07:30) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

#javascript(){{ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $("th:nth-child(odd)").addClass("odd"); $("tr:nth-child(even)").addClass("even"); $("tr:not(:first-child)").mouseover(function(){ $(this).addClass("hover"); }).mouseout(function(){ $(this).removeClass("hover"); }) $("td").mouseover(function(){ $("td:nth-child("+($("td").index(this)%$("th").size()+1)+")").addClass("hover"); }).mouseout(function(){ $("td:nth-child("+($("td").index(this)%$("th").size()+1)+")").removeClass("hover"); }) }) </script> }} #html2(){{{{{{ <style type="text/css"> <!-- table{ margin:100px auto; } .odd{ background:#444444; } th{ background:#222222; color:white; } th,td{ padding:5px; font-size:small; } .even{ background:#F2F2F2; } .hover{ background:#B2D8FF; } // --></style> <table> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> </table> }}}}}}
#javascript(){{ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $("th:nth-child(odd)").addClass("odd"); $("tr:nth-child(even)").addClass("even"); $("tr:not(:first-child)").mouseover(function(){ $(this).addClass("hover"); }).mouseout(function(){ $(this).removeClass("hover"); }) $("td").mouseover(function(){ $("td:nth-child("+($("td").index(this)%$("th").size()+1)+")").addClass("hover"); }).mouseout(function(){ $("td:nth-child("+($("td").index(this)%$("th").size()+1)+")").removeClass("hover"); }) }) </script> }} #html2(){{{{{{ <table> <tr> <th>test</th> <th>test</th> <th>test</th> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> </table> }}}}}}

表示オプション

横に並べて表示:
変化行の前後のみ表示: