JDBC + Swing: не удалось получить содержимое таблицы

Построен отважный ответ prc322.

function hideContainerOnMouseClickOut(selector, callback) {
  var args = Array.prototype.slice.call(arguments); // Save/convert arguments to array since we won't be able to access these within .on()
  $(document).on("mouseup.clickOFF touchend.clickOFF", function (e) {
    var container = $(selector);

    if (!container.is(e.target) // if the target of the click isn't the container...
        && container.has(e.target).length === 0) // ... nor a descendant of the container
    {
      container.hide();
      $(document).off("mouseup.clickOFF touchend.clickOFF");
      if (callback) callback.apply(this, args);
    }
  });
}

Это добавляет пару вещей ...

  1. Размещается внутри функции с обратным вызовом с «неограниченными» аргументами
  2. Добавлен вызов jquery's .off () в паре с пространством имен событий, чтобы отменить событие из документа после его запуска.
  3. Включено касание для мобильных функций

Надеюсь, это поможет кому-то!

0
задан Ankur Sinha 22 March 2013 в 16:53
поделиться