简体   繁体   中英

How to set webview area upon loading a link?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM