jquery .width doesn't work as expected in IE8 -


hello here's nice one...

i have drop down , when click open in ie8 ... position wrong because it's not reading width of div correctly... when click close jumps correct position , closes... works fine in other browsers works fine in ie7... reason ie8 doesn't want comply...

here's code...

http://jsfiddle.net/phzpv/2/

    $("#btn-login").click(function () {      var buttonpos = $(this).offset();      var logindropdown = $("#login-dropdown-wrapper");      console.log(logindropdown.width() + "px"); //  returns 4 px.... on dropdown... ok on slide up... returns 240px...       logindropdown.css({         "left": buttonpos.left - logindropdown.width() + $(this).outerwidth() + "px",             "top": buttonpos.top + 45 + "px"     })         .slidetoggle(400);      console.log(logindropdown.width() + "px"); // 1 returns 240px.....  }); 

there notes added in code explain issue....

any appriciated...

i can hard code width dont want since jquery took $.browser support away ... there no easy way of saying if(ie8) more... (not know of)... unless know future of ie8 causing can call $support thing , add exception....


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -