jonline Posted February 18, 2010 Posted February 18, 2010 I need like an expand and collapse column, I believe i will need javascript to do it but am not sure. could anyone show me a script that shows more or less for example like the youtube description boxes.
andrewq2 Posted February 20, 2010 Posted February 20, 2010 Something like this should work. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <script type="text/javascript"> function hideElement(i) { var e = document.getElementById(i); if (e) { e.style.visibility = 'hidden'; } } function showElement(i) { var e = document.getElementById(i); if (e) { e.style.visibility = 'visible'; } } </script> <title>Test Page</title> </head> <body> <div id="showhide"> The Text<br/> <a href="java script:hideElement('showhide')">Hide</a><br/> </div> <p> <a href="java script:showElement('showhide')">Show</a><br/> </p> </body> </html>
jontyy Posted February 24, 2010 Posted February 24, 2010 jQuery could also be used for this i think. using their slideDown() and slideUp() functions. i have used a similar technique on one of my projects. slideDown(): slideDown slideUp(): slideUp
flybyme Posted August 9, 2010 Posted August 9, 2010 jQuery could also be used for this i think. using their slideDown() and slideUp() functions. i have used a similar technique on one of my projects. slideDown(): slideDown slideUp(): slideUp jQuery should work a treat!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now