.prevUntil()


.prevUntil( [selector ] [, filter ] )Возвращает: jQuery

Описание: Осуществляет поиск всех элементов, лежащих начиная от одних заданных элементов и заканчивая другими.

  • Добавлен в версии: 1.4.prevUntil( [selector ] [, filter ] )

    • selector
      Тип: Selector
      A string containing a selector expression to indicate where to stop matching preceding sibling elements.
    • filter
      Тип: Selector
      A string containing a selector expression to match elements against.
  • Добавлен в версии: 1.6.prevUntil( [element ] [, filter ] )

    • element
      Тип: Element or jQuery
      A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
    • filter
      Тип: Selector
      A string containing a selector expression to match elements against.

Given a selector expression that represents a set of DOM elements, the .prevUntil() method searches through the predecessors of these elements in the DOM tree, stopping when it reaches an element matched by the method's argument. The new jQuery object that is returned contains all previous siblings up to but not including the one matched by the .prevUntil() selector; the elements are returned in order from the closest sibling to the farthest.

If the selector is not matched or is not supplied, all previous siblings will be selected; in these cases it selects the same elements as the .prevAll() method does when no filter selector is provided.

As of jQuery 1.6, A DOM node or jQuery object, instead of a selector, may be used for the first .prevUntil() argument.

The method optionally accepts a selector expression for its second argument. If this argument is supplied, the elements will be filtered by testing whether they match it.

Примеры использования