Link that scrolls to position
10,204
Solution 1
I don't have control of the linked page
All you can do is link to an anchor/ID on the page. If the first block of text on the targeted page has an ID attribute, then you can link to that:
wwww.example.com/page.html#blockOfTextID
Solution 2
No, you can only link to parts of the page that already have named anchors on the page.
Which links to my answer to your question. But only works, because Stack Overflow has HTML like:
<a name="7324427"></a>
Above every answer to make this possible.
Author by
James
Updated on August 02, 2022Comments
-
James almost 2 years
Is it possible to create a link to any web page and scroll to the position of the first instance of a block of text?
eg:
http://techcrunch.com/2011/09/06/google-api-launch-still-months-away/#scrollto"A Google project headed by Vic Gundotra"
and this will scroll to some where half way of the page.
Note: I don't have control over the linked page, it could be any page on the web. Is there any javascript trick that will allow me to do what I described?
-
James over 12 yearsIs there any javascript trick that will allow me to do what I described?
-
James over 12 yearsI already know this. thanks anyway. the problem is I don't have control over the linked page (it could be any page on the web)
-
DA. over 12 yearsRight. Well, that's all you can do.
-
DA. over 12 yearsIt's not your page. Therefore, you can't run any JS on it.
-
James over 12 yearswhat about putting it into an iframe and scroll that? is it possible?