| | Hi How can i open and close tables like this site www.ashiyane.com the right and left table has Plus Jpg and when you click on the table close ? Plz Help me thank |
|
|
QUOTE(faceofdie @ Dec 31 2004, 08:16 AM) Hi How can i open and close tables like this site www.ashiyane.com the right and left table has Plus Jpg and when you click on the table close ? Plz Help me thank you should use a DIV to hold the information in the table and give it a name. That div can be "collapsed" by changing the HEIGHT property through javascript. CODE <table border=1> <tr><td><img src="arrowup.gif" id=arrow onclick="collapse();"></td></tr> <tr><td><div id=div1 style="height:100px;overflow:auto">Your info here</div></td></tr> </table> you have to use java script to create the function "collapse" that is called using the "onclick" event for the arrow image. in the javascript function you have to change the height of the DIV (named "div1" in this case) and also change the arrow image (named "arrow") CODE <script> var originalwindowsize=100; function collapse() { if (document.all.div1.style.height != "1px") { originalwindowsize=parseInt(document.all.div1.style.height); document.all.div1.style.height=1; document.all.div1.style.overflow="hidden"; document.all.arrow.src="arrowdown.gif"; } else { document.all.div1.style.height=originalwindowsize; document.all.div1.style.overflow="auto"; document.all.arrow.src="arrowup.gif"; }} </script> This code will only work in IE (document.all)... I will let you figure out the equivalent for netscape/firefox/etc. If you want, you can view the source on my website for the firefox/etc. code but mine is a little more complicated than the one listed above.
|
|
![]() How Can I Close And Open Tables |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|