Bug Tracker

Modify

Ticket #10543 (closed enhancement: plugin)

Opened 3 years ago

Last modified 2 years ago

findChildren (opposite of closest)

Reported by: mp@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version:
Keywords: Cc:
Blocking: Blocked by:

Description

I had to use a function which looks up an element matched by an expression inside a targetElement. So something like the opposite of closest(). Because i did not find a function for that in the jQuery-Framework i wrote some snippet my self: jquerySorter = { findChildren: function(start, match){

if(!$(start).children(match)[0]){

return jquerySorter.findChildren($(start).children('*'), match);

} else {

return $(start).children(match);

}

}

}

This is a Part of the complete SortingPlugin i wrote. I hope this helps to implement a function which is like the opposite of closest, because i think lots of poeple need this.

regards Mark Paspirgilis

Change History

comment:1 Changed 2 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to plugin

This doesn't seem common enough to put into core, but can easily be done inline or via a plugin.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.