On Sep 29, 6:03 pm, giuliano <[email protected]> wrote:
> Hi,
>
> I noticed that if I scroll down a long page in my jqtouch app, then go
> to another page and come back to the scrolled one, the first page
> stays scrolled down and doesn't automatically scroll to the top before
> loading.

That has nothing to do with jQuery (if I understand your statements
above correctly), it is a standard behaviour of most browsers.

> How can I change this behavior?

Change browsers. Chrome, for example, always returns to the top of the
page whereas Safari, IE and Firefox return to the scrolled position.

You may be able to use the onload even to scroll to the top, but some
browsers don't dispatch an onload event when a page is visited using
the back button, others do.


> For me it is a problem because, for example, I have a list of items
> and the option to go to a page with filter options for these items,
> but, if a user scroll down before filtering, the script will load the
> the filtered items but the 'view" vertically will start from when the
> user left not from the top.
>
> Hope I have been clear

Clear as mud.

Is the navigation away a plain link, or are you using a script link?
If the latter, scroll to the top of the page before navigating to the
filter page so when the user comes back, the page is scrolled up. They
might be a bit annoyed though if the navigation fails and they are put
to the top of the page regardless.

Alternatively, the function that filters the page on return (does
Mobile Safari dispatch a load event in this case?) can scroll up the
page.

What happens if the filter increases the number of options? Does the
user still want to be taken to the top of the page? After all, they
just need to tap the top bar and they are back to the top anyway - is
one tap really too much to ask? At least the fact that they've had to
scroll up confirms that the page was filtered.


--
Rob

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to