jQuery Untils v1.0

|

A while back, I coded up a very basic nextUntil method, but it felt a bit simplistic. I felt that I could code a slightly more “general” solution that actually sorted correctly.. so here’s the result:

jQuery Untils provides three very simple, but very useful methods: nextUntil, prevUntil, and parentsUntil. These methods are based on their nextAll, prevAll, and parents counterparts, except that they allow you to stop when a certain selector is reached. Elements are returned in “traversal order”.

Note that these methods take a less naïve approach than others bearing the same names, and are designed to actually return elements in traversal order, despite the element ordering flaws inherent in the jQuery 1.3.2 selector engine. A ticket and patch have been submitted to the jQuery team for hopeful inclusion in the 1.4 release.

Check out the documentation and examples at the plugin page, and let me know what you think in the comments!

Post A Comment

  • Any of these HTML tags may be used for style: a, b, i, br, p, strong, em, pre, code.
  • Multi-line JavaScript code should be wrapped in <pre class="brush:js"></pre>
    (supported syntax highlighting brushes: js, css, php, plain, bash, ruby, html, xml)
  • Use &lt; instead of < and &gt; instead of > in the examples themselves.