Skip to content
Permalink
Browse files

Fixed bug #178

  • Loading branch information
jzaefferer committed Sep 16, 2006
1 parent 43d3deb commit 1293e80ff9afa96198c81fa79aa267a4ee44d9d1
Showing with 11 additions and 9 deletions.
  1. +11 −9 src/jquery/jquery.js
@@ -1916,15 +1916,17 @@ jQuery.extend({
*/
sibling: function(elem, pos, not) {
var elems = [];

var siblings = elem.parentNode.childNodes;
for ( var i = 0; i < siblings.length; i++ ) {
if ( not === true && siblings[i] == elem ) continue;

if ( siblings[i].nodeType == 1 )
elems.push( siblings[i] );
if ( siblings[i] == elem )
elems.n = elems.length - 1;

if(elem) {
var siblings = elem.parentNode.childNodes;
for ( var i = 0; i < siblings.length; i++ ) {
if ( not === true && siblings[i] == elem ) continue;

if ( siblings[i].nodeType == 1 )
elems.push( siblings[i] );
if ( siblings[i] == elem )
elems.n = elems.length - 1;
}
}

return jQuery.extend( elems, {

0 comments on commit 1293e80

Please sign in to comment.
You can’t perform that action at this time.