views:

61

answers:

2

default condition

alt text

After clicking on Sitemap link

How to write HTML to get footer links after the sitemap tree upon clicking on Sitemap link?

alt text

A: 

Style the links and the sitemap in a layout that you desire, then add the following JavaScript (tag the sitemap with id #sitemap and the link with id #smLink):

function toggleSitemap() {
  var sitemap = document.getElementById('sitemap'),
      smLink  = document.getElementById('smLink');
  smLink.innerHTML = (smLink.innerHTML == 'Sitemap -') ? 'Sitemap +' : 'Sitemap -';
  sitemap.style.display = (smLink.innerHTML == 'Sitemap -') ? 'block' : 'none';
}
document.getElementById('smLink').addEventListener('click', toggleSitemap, false);
Delan Azabani
but after clicking i need footer link at bottom of sitemap.
metal-gear-solid
Like I said, use CSS to lay out the elements as you wish; that's the JavaScript code to handle the actual show/hideing.
Delan Azabani
+2  A: 

Jquery show and hide are your friends. Or, an even easier solution is to use toggle!

$('#show_hide').click(function(){
  $("#links").toggle();
  return false;
});
thebluefox
i need help in html also
metal-gear-solid
In what respect? Styling? Or simply constructing the html?
thebluefox
when user will click on sitamap button then link of footer should shift under the sitemap tree
metal-gear-solid
Create 2 columns. In the right hand one is the sitemap link, in the left hand one is the sitemap (div) and the footer links (p tag). Give the columns fixed widths and float each one left or right. Let me know if that helps!
thebluefox
ok will try - thanks
metal-gear-solid