views:

63

answers:

5

Is there a way to link to another page's content using coordinates, without using #anchors? For example, say I want the link to go directly to content that's 1200px down the page. How can I do this? Javascript, server-side magic, anything goes as long as it will work for the average visitor.

A: 

You could develop a browser plugin or extension that would allow you do it, for the people who've installed it at least. Otherwise, no.

Reinis I.
A: 

If you have control of the other website, you could write a javascript that looks at the query string for a parameter (i.e. ?y=1200) and scrolls the page to that position, but I'm guessing you don't have access to the other site?

pixel
A: 

This can be done with UserJS (Greasemonkey):

http://stackoverflow.com/##scroll-y:1200

But users must install script before.

NV
+1  A: 

Store the coords in a hash

e.g. http://example.com/page#123

Then via javascript, scroll the window

window.onload = function(){
  var pos = window.location.hash.substring(1); //get hash & remove #
  window.scroll(0,pos);
};
troynt
the link doesn't work for me.
IronGoofy
Yea, unfortunately my solution requires JS to be injected into the page either by extension of the browser or addition to the website by the webmaster.
troynt
A: 

The browser same origin policy will prevent you from scrolling a frame or iframe displaying content from a different domain. The most reliable method would be to have your server fetch the page and insert the scrolling code.

Annabelle