siblings.js 203 B

123456789101112131415
  1. define( function() {
  2. return function( n, elem ) {
  3. var matched = [];
  4. for ( ; n; n = n.nextSibling ) {
  5. if ( n.nodeType === 1 && n !== elem ) {
  6. matched.push( n );
  7. }
  8. }
  9. return matched;
  10. };
  11. } );