#4273 closed bug (invalid)
siblings() not working in IE
Reported by: | ap | Owned by: | john |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | core | Version: | 1.3.2 |
Keywords: | siblings | Cc: | |
Blocked by: | Blocking: |
Description (last modified by )
this generates an error in IE:
element.siblings()[ ColumnIndex ];
I am currently using this workaround:
/** * Works in IE. * keep this comment to reuse freely: * @see http://www.fullposter.com/?1 */ function siblings(element) { // use jquery for FF if ( element.siblings ) return element.siblings(); // do it manually if (typeof element == "string") { element = document.getElementById(element); }; if (!element) { return null; }; var siblings = []; var elementcopy = element; while (elementcopy.previousSibling) { if (elementcopy.previousSibling.nodeType == 1) siblings.unshift(elementcopy.previousSibling); elementcopy = elementcopy.previousSibling; } elementcopy = element; while (elementcopy.nextSibling) { if (elementcopy.nextSibling.nodeType == 1) siblings.push(elementcopy.nextSibling); elementcopy = elementcopy.nextSibling; } return siblings; }
Change History (3)
comment:1 Changed 14 years ago by
Owner: | set to john |
---|
comment:2 Changed 13 years ago by
Component: | unfilled → core |
---|---|
Description: | modified (diff) |
Milestone: | 1.3.2 |
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
No response to test case request.
Note: See
TracTickets for help on using
tickets.
Do you have a test case (HTML and script) that shows this problem occurring?