Ms7 Search
Google 搜尋 翻譯
calendar
« 九月 2018 »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
近期文章
文章分類
網站連結
Syndicate

網頁上改為向下移動

2018-09-25 @ 14:09 in PHP, JavaScript, Sql

//網上找到 jquery 在網頁時,將 Enter 鍵改為 Tab 的作用
 $("input").not( $(":button") ).keypress(function (evt) {
        if (evt.keyCode == 13) {
            if ($(this).attr("type") !== 'submit'){
                var fields = $(this).parents('form:eq(0),body').find('button, input, textarea, select');
                var index = fields.index( this );
                if ( index > -1 && ( index + 1 ) < fields.length ) {
                    fields.eq( index + 1 ).focus();
                }
                $(this).blur();
                return false;
            }
        }
    });