is there anyway to link to a certain part of a page, say 1000 pixels down or is the only way to do this with an anchor.
Yeah you’re pretty much stuck with using an anchor for that.
Of course it may be possible to use javascript to set the focus on an element that’s down the page 1000px. I’ve never tested that though so I’m not sure if it would work or not. If it worked, well that would be cool, but you’d also have a few other things to take into consideration.
There seems to be a way: http://www.w3schools.com/htmldom/met_win_scrollto.asp
I am linking to an external page thats not mine and want to link to cartain part way down that page, and there’s not and anchor there.
The java way looks interesting - but I dont think I can use java on someone elses page? Isnt it a security issue. Unless you can?
You may want to try using a div with display:absolute and put the linked page in an inline frame. Then, place the entire div (make the iframe as high as the page you wish to show) upwards, like so:
<body>
<div style="display:absolute; top: -1250px;">
<iframe src="http://www.yourlinkedpage.com/" height="verybig" width="100%"></iframe>
</div>
</body>
The problem is that the user is unable to scroll through the page… It’s not a very elegant solution but it may get the job done.
Kind regards,
Maurits
Man I forgot all about that!
The java way looks interesting - but I dont think I can use java on someone elses page? Isnt it a security issue. Unless you can?
I guess you can. Atleast if you use popups:
<html>
<head>
<script type="text/javascript">
function open_win()
{
var z = window.open("http://www.w3schools.com","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=600, height=600");
z.onload = function () {
this.scrollTo(100,500)
}
}
</script>
</head>
<body>
<form>
<input type="button" value="Open Window" onclick="open_win()">
</form>
</body>
</html>