码迷,mamicode.com
首页 > Web开发 > 详细

js 上移下移行

时间:2014-06-26 17:12:58      阅读:267      评论:0      收藏:0      [点我收藏+]

标签:ext   html   cti   for   htm   io   

function up_tr(sender) {
                            var tr = $(sender).parent().parent();
                            var table = tr.parent();
                            var first = $("tr:first", table);
                            if (tr.html() == first.html()) {
                                alert("已經是第一行了");
                            } else {
                                tr.prev().insertAfter(tr);
                            }
                        }
                        function down_tr(sender) {
                            var tr = $(sender).parent().parent();
                            var table = tr.parent();
                            var last = $("tr:last", table);
                            if (tr.html() == last.html()) {
                                alert("已經是最後一行了");
                            } else {
                                tr.next().insertBefore(tr);
                            }
                        }

js 上移下移行,布布扣,bubuko.com

js 上移下移行

标签:ext   html   cti   for   htm   io   

原文地址:http://www.cnblogs.com/liuliuwei/p/3808726.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!