nextSibling difference between IE and FF?

Posted by Ahmet Yildirim on Stack Overflow See other posts from Stack Overflow or by Ahmet Yildirim
Published on 2011-01-02T12:57:27Z Indexed on 2011/01/02 23:54 UTC
Read the original article Hit count: 234

Hi fellows,

I just wrote a javascript code for layering in raphaeljs it works perfectly on FF. But it doesn't on IE. The problem is IE returns null for nextSibling for any object.

How does one use it correctly, or is there a nextElementSibling call in IE?

Here is the code fragment I used to change the order of objects:

n = items[selected_item_id].nextSibling.id;
if (n != '') {
  items[selected_item_id].insertAfter(items[n]);
}

<div id="consarea">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%">
<desc>Created with Raphaël</desc>
<defs/>
<rect x="188" y="100" width="200" height="200" r="10" rx="10" ry="10" fill="#ee8515" stroke="none" style="opacity: 1;" opacity="1"/>
<rect x="253" y="158" width="50" height="50" r="0" rx="0" ry="0" fill="#0080ff" stroke="none" style="opacity: 1;" opacity="1" id="0"/>
<rect x="230" y="140" width="50" height="50" r="0" rx="0" ry="0" fill="#c03022" stroke="none" style="opacity: 1;" opacity="1" id="1"/></svg>

here it is above. the piece of the html im working on

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about internet-explorer