开发者

overlay content retains scroll

I have googled and fiddled with this for hours!

I have a map that is using an image map for states that when clicked produces an overlay that shows (from the database via AJAX) all of the universities in that state that we serve and the properties serving each university...works fine!

However, if you scroll within the overlay on one state, close that state and click on another state, the second states listin开发者_运维技巧g shows with the same offset of the scrolling for the first state (wow, that doesn't sound confusing, right?).

What I need is a solution to ensure that each overlay will appear with the TOP of the listing at the top of the DIV in which it appears.

if seeing the page helps, it is in development at http://dev.edrtrust.com/myownapt/index.php/conn/index.

Thanks in advance, Jon


No plugin required. Just change line 19 of the page you linked to as follows:

$('#stateListing').empty().append(data).scrollTop(0);

The scrollTop(0) tagged on the end there should do the trick.

Update: If that's not working, you may need to shift $('#stateListing').scrollTop(0); around, either just before or just after $.post() to see what works.


How about this plugin?

http://plugins.jquery.com/project/ScrollTo

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜