html - CSS JQuery Position Selector is null on IE -


i have problem jquery position() code. code works on chrome/firefox fails on ie.

the js code is:

function myfunc() {  var x = $("#menu li.active"); if (x == null)   alert('x null'); else     alert(x.position().left + " " + x.position().top); }  $(document).ready(function() { myfunc(); }); 

and html is:

<ul id="menu">     <li class="active"><a href="test.php"><span>test 1</span></a></li>     <li><a href="test2.php"><span>test 2</span></a></li> </ul> 

normal browsers returns left , top values, , ie says:

message: 'position().left' null or not object

thanks in advance.

i found problem. html header was:

<html dir="rtl"> 

and that's caused problem in case. when set page ltr works on ie.

thanks.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -