开发者

Issue with jQuery position in IE7

Hi All I've written this little bit of c开发者_运维百科ode that looks at the position of an element then hides a div if it's total is higher then 20. My issue is that it doesn't seem to run in IE7 working fine in Firefox, Safari etc. Just wondering if anyone could tell me why.

var positiontabs = $(".ajax__tab_active").position();
var positiontabshead = $(".ajax__tab_header").position();
var positiontabssum = positiontabs.top - positiontabshead.top;

if (positiontabssum > 20) {
  $('.ajax__tab_header').hide();
}
else if (positiontabssum < 20) { 

} else {

}


The only time I've seen something similar is if the values aren't integers - that's usually when position stuff, tho'. You could try putting a parseInt round the values or the sum.

File this under "probably clutching at straws" tho' :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜