English 中文(简体)
处理装饰材料的问题
原标题:Problem getting jQuery offset() to work on ajax loaded content

在我的代码中,offset(>> 对于装自亚x或load(<>) 方法的部件,总回报0,0?

连续样码:

jQuery("#div1").load(url, function() {
   var offset = jQuery("#some-div-in-new-content").offset();
   // offset is always 0,0
});

我已证实,j Query(“#some-div-in-new-content”)正在发现该物体——其他特性良好。

问题回答

I have had a similar problem and checking the position of the newly loaded elements with offset().top revealed that my problem was with not using clear: both; after the element. Maybe it will help someone.

在我的案件中,Laded RUS 母子是隐蔽的,因此被抵消为零。 因此,在装上超文本反应后,可以发现这种反应或其上级,然后计算抵消。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签