zoukankan      html  css  js  c++  java
  • 方向键 移动checkboxlist焦点

      http://www.cnblogs.com/zhangziqiu/archive/2009/04/30/jQuery-Learn-1.html  jquery

     series.SmartLabelStyle.Enabled = false;

    $(function() {

            var baseIndex = 100;

            $("#tblGrid")

            .find("tr").each(function(r) {

                $(this).find("td").each(function(c) {

                    $(this).find("input")

                    .attr("tabindex", r * 100 + c + baseIndex)

                    .addClass("cGridInput");

                });

            });

            $("#tblGrid .cGridInput").live("keydown", function(evt) {

                var tabIndex = parseInt($(this).attr("tabindex"));

                switch (evt.which) {

                    case 38: //上

                        tabIndex -= 100;

                        break;

                    case 40: //下

                        tabIndex += 100;

                        break;

                    case 37: //左(會導致輸入時無法使用左右移)

                        tabIndex--;
                        break;

                    case 39: //右(會導致輸入時無法使用左右移)

                        tabIndex++;

                        break;

                    default:

                        return;

                }

                if (tabIndex > 0) {

                    $(".cGridInput[tabindex=" + tabIndex + "]").focus();

                    return false;

                }

                return true;

            });

        });

  • 相关阅读:
    1、听说过Redis吗?它是什么?
    55、数据库高并发是我们经常会遇到的,你有什么好的解决方案吗?
    54、数据库如何保证持久性?
    53、数据库如何保证原子性?
    52、数据库如何保证一致性?
    注解定义、基本语法和属性
    Macbook 装机必备--开发篇
    http
    python:beaufiful
    python-yield
  • 原文地址:https://www.cnblogs.com/standy225/p/2583876.html
Copyright © 2011-2022 走看看