...

View Full Version : new page loads at bottom???



boasey
10-11-2008, 07:21 PM
Newbie - please be gentle.

Hope someone can help. I've spent a couple of days trying to have a go at this myself but cannot figure it out. I'm a complete javascript novice.

I have a content page that opens in an iFrame and the content is then scrollable so that you can see the stuff at the bottom of the page. When you click on a picture link at the bottom of this page it opens a new content page in the iFrame with larger pics etc but it opens it at the bottom of the new page (where the previous page scroll was).

I have tried using the <a href="url.htm#top" anchor link to go to an anchor point on the new page with <a name="top"></a> on the new page...that didn't work.

I have tried numerous onLoad functions to anchor points and numerous pagescroll() functions but cannot get it to work.

The site in question is in working progress at http://www.mostwantedclothing.co.uk/
click on the 'one more round' link in the nav on the left and then scroll down to the very last row and click on the middle pic (only this one active for testing purposes) and you'll see the new page with big pics open at the bottom instead of the top.

Thanks in advance.

mic2100
10-11-2008, 11:32 PM
u cud try make a piece of javascript that clicks the link

u would need to change ur link to have an ID



<script>

function tothetop()
{

document.getElementById("top_link").click();

}

window.onload = tothetop;

</script>
<a href="#top"> //currently
<a href="#top" name="top_link">


shud do it, but i havn't tested so let me know if it works.

boasey
10-12-2008, 02:21 AM
Hi Thanks for your reply.

Does all of the code go between the 'head' and not sure what you mean by 'change ur link to have an ID'

Told you I was a newbie :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum