Bug Tracker

Opened 10 years ago

Closed 8 years ago

Last modified 7 years ago

#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 dmethvin)

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 10 years ago by dmethvin

Owner: set to john

comment:2 Changed 9 years ago by dmethvin

Component: unfilledcore
Description: modified (diff)
Milestone: 1.3.2

Do you have a test case (HTML and script) that shows this problem occurring?

comment:3 Changed 8 years ago by dmethvin

Resolution: invalid
Status: newclosed

No response to test case request.

Note: See TracTickets for help on using tickets.