Forked from: homunechin's テーブル行の複製 View Diff (50) テーブル行の複製 一括チェックボックス選択 homunechin Follow 2011-08-24 00:17:08 License: MIT License Fork0 Fav2 View3210 Play Stop Reload Fullscreen Smart Phone Readme JavaScript 18 lines HTML 14 lines CSS 32 lines ・テーブル行の複製 ・テーブル行の削除 ・チェックボックス一括選択、解除 テーブル行の複製 一括チェックボックス選択 jQuery v1.6.2 // 複製ボタン押下 $('.copy_line').click(function() { $copy_line = $(this).parent().parent(); $(this).parent().parent().clone(true).insertAfter($copy_line); }); // 削除ボタン押下 $('.delete_line').click(function() { $(this).parent().parent().remove(); }); // checkbox ON OFF $('#chk_all').click(function() { var $checked = $(this).attr('checked'); if($checked){ $(".chk_flg").attr('checked','checked'); }else{ $(".chk_flg").removeAttr('checked'); } }); <table border="1"> <tr> <th><input type="checkbox" name="chk_all" id="chk_all" value="1"></th> <th></th> <th></th> <th></th> </tr> <tr> <td><input type="checkbox" name="chk_flg" class="chk_flg" value="1"></td> <td>複製したい行</td> <td><input type="button" name="copy_line" class="copy_line" value="複製"></td> <td><input type="button" name="delete_line" class="delete_line" value="削除"></td> </tr> </table> テーブル行の複製 一括チェックボックス選択 YUI 3.3.0 CSS Base YUI 3.3.0 CSS Fonts YUI 3.3.0 CSS Reset body { color: #24282b; font-family:"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif; } table { width: 400px; margin:10px; border-collapse: collapse; border: 1px solid #548582; background-color: #fcf9ca; } th { padding: 5px; border-bottom: 3px double #548582; background-color: #9fc7b2; text-align: left; } td { border-bottom: 1px dotted #548582; } // Set up the color and transition time input[type=button] { background-color: #0000aa; -webkit-transition: -webkit-transform 0.3s ease-in-out; } // This is for the click action: input[type=button]:active { background-color: #000099; -webkit-transform: rotate(360deg); } ・テーブル行の複製 ・テーブル行の削除 ・チェックボックス一括選択、解除 // 複製ボタン押下 $('.copy_line').click(function() { $copy_line = $(this).parent().parent(); $(this).parent().parent().clone(true).insertAfter($copy_line); }); // 削除ボタン押下 $('.delete_line').click(function() { $(this).parent().parent().remove(); }); // checkbox ON OFF $('#chk_all').click(function() { var $checked = $(this).attr('checked'); if($checked){ $(".chk_flg").attr('checked','checked'); }else{ $(".chk_flg").removeAttr('checked'); } }); <table border="1"> <tr> <th><input type="checkbox" name="chk_all" id="chk_all" value="1"></th> <th></th> <th></th> <th></th> </tr> <tr> <td><input type="checkbox" name="chk_flg" class="chk_flg" value="1"></td> <td>複製したい行</td> <td><input type="button" name="copy_line" class="copy_line" value="複製"></td> <td><input type="button" name="delete_line" class="delete_line" value="削除"></td> </tr> </table> body { color: #24282b; font-family:"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif; } table { width: 400px; margin:10px; border-collapse: collapse; border: 1px solid #548582; background-color: #fcf9ca; } th { padding: 5px; border-bottom: 3px double #548582; background-color: #9fc7b2; text-align: left; } td { border-bottom: 1px dotted #548582; } // Set up the color and transition time input[type=button] { background-color: #0000aa; -webkit-transition: -webkit-transform 0.3s ease-in-out; } // This is for the click action: input[type=button]:active { background-color: #000099; -webkit-transform: rotate(360deg); } use an iframe compat browser, deer Play on jsdo.it games Author Share ブログに埋め込む QR Tag Download Complete! Description What kind of game? ・テーブル行の複製 ・テーブル行の削除 ・チェックボックス一括選択、解除 Control Device Smartphone Controllerjsdo.it WebSocket Controller» Mouse Keyboard Touch Device Fullscreen Activated Inactivated jsdo.it games から削除する Submit Author homunechin URLhttp://blog.livedoor.jp/homunechin/ Web系まとめサイトのブログやってます。 Tweet Default Panel Auto play Screenshot Readme JavaScript HTML CSS Size Width: px Height: px code <script type="text/javascript" src="http://jsdo.it/blogparts/1R0U/js"></script> clone jQuery remove Discussion Questions on this code? Tags clone jQuery remove Favorite by Takaaki.Tana sekka