mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fixed bug #178
This commit is contained in:
parent
43d3deb7c8
commit
1293e80ff9
20
src/jquery/jquery.js
vendored
20
src/jquery/jquery.js
vendored
@ -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, {
|
||||
|
Loading…
Reference in New Issue
Block a user