scroll to anchor
scroll to anchor
- Subject: scroll to anchor
- From: Anthony B Arthur <email@hidden>
- Date: Tue, 25 Mar 2008 12:32:32 -0400
I have code that will scroll to an anchor after a page refresh, but it always goes to the top. How can I make it refresh with the anchor in the middle, or better yet, refresh with the anchor exactly where it was when the user invoked a submit? The code I have is:
public void appendToResponse(WOResponse response, WOContext context) { if (pageAnchor != null && advanceToAnchor) { response.setHeader(context.componentActionURL() + "#" + pageAnchor, "location"); response.setHeader("text/html", "content-type"); response.setHeader("0", "content-length"); response.setStatus(302); pageAnchor = null; advanceToAnchor = false; }else{ super.appendToResponse(response, context); } }
Any ideas?
-b
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden