I'm losing my mind.
I'm using this method for a tabbar:
http://groups.google.com/group/jqtouch/browse_thread/thread/f052748b50e9acd0
Now when I scroll down a page, then go to another page, then come
back, it seems like the scroll position remains.
Add a few dynamic content insertions and you can see I'm in scrolling
hell :)
For example, if I load content into a page that's not a long as the
content I had on it before, it now shows an empty page which I can't
even scroll up - and in anycase my users won't even know that they
need to scroll up to see the new content...
I've tried scrolling up automatically but with no luck (here's my
stack-overflow question about it:
http://stackoverflow.com/questions/6719330/scrolltop-only-scrolls-down
)
Here's my page:
<div id="searchResults">
<div class="toolbar">
<h1>title</h1>
</div>
<div class="vertical-scroll use-bottom-toolbar" id="resBod">
<div id="resSc"><!-- needed for tabbar -->
<ul class="rounded propertieslist">
<!-- Content is loaded with AJAX -->
</ul>
</div>
</div>
<div class="toolbar tabbar bottom"><!-- the tabbar -->
<span class="tab_about"><span><a class="dissolve"
href="#about">about</a></span></span>
<span class="tab_contact"><span><a class="dissolve"
href="#contact">contact</a></span></span>
<span class="tab_rent"><span><a class="dissolve"
href="#searchRent">Search1</a></span></span>
<span class="tab_sale"><span><a class="dissolve"
href="#searchBuy">Search2</a></span></span>
<span class="tab_search tab_on"><span><a class="dissolve"
href="#home">Page</a></span></span>
</div>
</div><!--/End of jqtouch Page-->
And here's how I'm trying to scroll with jQuery:
$('#searchResults').bind('pageAnimationEnd', function(e, info){
// some code to load ajax content here
var resSc = $('#resSc');
var resScH = $('#resSc').height();
resSc .scrollTop(resScH);
$('#resSc').animate({scrollTop:0}, 1000);
});
But it doesn't work at all... Can anyone help please?
(Note: My app is only used on iPhone, so only has to support Safari
Mobile (I'm stating this since I noticed in previous posts this might
have to do with browser behaviour)