Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

click to show text needs a focus

click to show text needs a focus

3:28 pm on Jul 17, 2008 (gmt 0)

Junior Member

10+ Year Member Top Contributors Of The Month

joined:Feb 3, 2004
posts: 88
votes: 0

I've got some text that appears if you click "sitemap". The sitemap text appears at the bottom of the page. I want the focus to go there so the page scrolls down to it. I can't however seem to get anything I try to work.

Here's what I've got right now.

<script language="javascript">

function footer_hideall()

function footer_display(my_object)
if(document.getElementById(my_object).style.display != "")
document.getElementById(my_object).style.display = "";

<a href="javascript: footer_display('layer_sitemap')" class="link_footer" onclick="window.scrollTo(0,document.getElementById('tabber').offsetTop);return false;">SITE MAP</a>

<div id="tabber" style="overflow: auto;">
<div id="layer_sitemap" style="padding-top: 0px;">

I could use some help.

6:03 pm on July 17, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 4, 2002
votes: 0

If you add this to the place in your script where you want the focus to change, it should work like clicking an anchor:

window.location = window.location + "#layer_sitemap";