homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

click to show text needs a focus
click to show text needs a focus

10+ Year Member Top Contributors Of The Month

Msg#: 3700885 posted 3:28 pm on Jul 17, 2008 (gmt 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.



10+ Year Member

Msg#: 3700885 posted 6:03 pm on Jul 17, 2008 (gmt 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";

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved