0
   

Show part of my home page -hide the other paart behind a link

 
 
Reply Mon 16 Mar, 2009 08:07 am
My home page is too long, I am trying to show some of it when I open my website then if I need more I can click on a link to open the rest of the page.
I am looking for HTML code, but I need a link to show the rest of the page and not to open a new page.

Thanks
 
View best answer, chosen by ammaryameen
View Profile Robert Gentel
  Selected Answer
 
  2  
Reply Mon 16 Mar, 2009 01:04 pm
There are many different ways you can do this. You can use ajax to fetch content, or you can just use javascript to modify the css of a hidden element. Here's a simple example with a hidden element and a link that will show it.

Code:<a onclick="document.getElementById('elementId').style.display = '';" style="cursor:pointer;">show</a>
<div id="elementId" style="display:none;">
hidden content
</div>


If you need it to toggle (show and hide) then you can set it back to "display:none".

You may also find javascript libraries like YUI, jquery, and mootools useful for this kind of thing if you end up doing more of it on your site.
0 Replies
 
 

Related Topics

I'm the developer - Discussion by Nick Ashley
how to earn money in internet - Discussion by rizwanaraj
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
mod rewrite for a different theme? - Discussion by etali
 
  1. able2know
  2. » Show part of my home page -hide the other paart behind a link
Copyright © 2009 Horizontal Verticals :: Page generated in 0.34 seconds on 11/24/2009 at 10:56:17 Top End