views:

40

answers:

1

Ok so I have an rss reader that links to articles. One of the sites it links to doesn't have a mobile view. I was wondering if anyone knew if it was possible to set the "zoom" and position of the view once the page is loaded? So for instance if the following link were my article... http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7

Then how could I have the view focus on the article without the user having to zoom in and scroll the the top of the article. Thanks.

A: 

I think, you have to use an anchor, which are based on the ids of the HTML code. Then, you have to pass the Id you want to stick to after the url and a #. With your example, it would give something like that : http://www.neworleanssaints.com/news-and-events/article-1/Saints-agree-to-terms-with-7th-round-pick-Sean-Canfield/cce6a9ca-eaee-4878-ad40-0b98609f7fe7#c1256209263986

As the div you are looking for has an id (lucky you cause they don't have all the time) <div id="c1256209263986" class="iw_component"><div xmlns:esi="http://www.edge-delivery.org

Hope this will help you (Try to click on the link I put, this should open the page at the start of the article.) I never tried that but have a go a this, and come back to tell me if it worked.

Sephy
Alright I'm going to get at it later today and will definitely come back with my findings. I'll also try and find a way to set the zoom but that should be the easy part! :) Thanks again
fwaokda
It works very nicely aligning the top of the article with the top of the browser but the left of the browser is at the leftmost part of the site. So I guess now I just have to figure out how to align it to the left of the article. Thanks!
fwaokda
I don't understand your issue of left alignement...
Sephy
This is a screenshot of what happens. So I'm hoping to find a way to have the left part of the browser align with the article. http://img816.imageshack.us/img816/9534/devicee.png
fwaokda
Then I see 2 options : either you use computeScroll() method if you know the width of the div on the left. Or you change the way you load the data in your webview. I mean, that you get the content of the url with a HTTP request (if that's not what you're already doing lol) and then get rid of the div on the left by : adding display:none in its opening tag, or changing the CSS, or whatever you can think of...
Sephy