我使用此處的代碼http://www.korvus.com/blog/geek/making-the-tab-key-work-with-jeditable-fields/來獲取工作在jeditable字段之間的選項卡,並且如果這些字段本身可以正常工作,不過,我需要將我的字段放在一個表中,並且唯一一次Tab鍵的作用是從最後一個字段到第一個字段,當然,我需要它從第一個字段到下一個字段,依此類推......在表格中的jeditable字段之間切換
$('div.edit').bind('keydown', function(evt) {
if(evt.keyCode==9) {
$(this).find("input").blur();
var nextBox='';
if ($("div.edit").index(this) == ($("div.edit").length-1)) {
nextBox=$("div.edit:first"); //last box, go to first
} else {
nextBox=$(this).next("div.edit"); //Next box in line
}
$(nextBox).click(); //Go to assigned next box
return false; //Suppress normal tab
};
});
表的格式像這樣提前
看到http://stackoverflow.com/questions/885616/tab-key-with-jeditable-fields – 2011-09-01 14:14:42