這是最近三個月寫得最完美的作品了,用JS實現了一個拖拽排序,效果圖如下:
復制代碼 代碼如下:
for(var j = 0; j < div_count; j++){
if(($("#eva_div_all").children().eq(j).children().children().eq(0).attr('checked'))=='checked'){
var valid_checked = $("#eva_div_all").children().eq(j).children().children().eq(0).attr('id');
if(valid_checked==checked_name){alert(alert_des);return;}
/* 對調 */
var temp = $("#eva_div_all").children().eq(j).attr('id');
var temp_html = $("#"+temp).html();
var before_temp = $("#eva_div_all").children().eq(j+num).attr('id');
var before_temp_html = $("#"+before_temp).html();
$("#"+temp).html('');
$("#"+before_temp).html('');
$("#"+temp).html(before_temp_html);
$("#"+before_temp).html(temp_html);
checked = 'true';
new_order();
}
}
if(checked=='false'){
alert('無選擇項!!');
}
復制代碼 代碼如下:
$("#eva_div_all").children().eq(j).children().children().eq(0).attr('checked'))=='checked')
她是firefox 23, 我的是16.0.1。很開心,終算找到問題的癥結了,此事算是告一段落。
新聞熱點
疑難解答
圖片精選