I’m making an AJAX backend framework for the administration of a flash game I’ve been working on. I haven’t done any HTTP Request / Scriptaculous stuff for a while now, so I was quite surprised when everything started working first time.
The basic setup is a list of items that expand / contract when clicked upon. You can see my basic structure here:
http://testing.duncanhall.net/TESTING/display.html
Clicking on the “show” link to the right will expand the detaild for that entry. It then becomes a “hide” link, which will contract the details back down again when clicked.
This all works perfectly, except if you expand several items so that the content extends beyond the natural height of the window. Now, when you click one of the “hide” links for one of the items towards the bottom of the list, it does as it should, but the focus also jumps to the top of the page. This isn’t anything major, but it could get annoying if the list becomes quite large as you would keep losing your place.
I hope I’ve explained this well enough. If anyone knows how I can prevent focus from leaping to the top of the page, I would greatly appreciate some help.