Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How Can I Close And Open Tables
faceofdie
post Dec 31 2004, 12:16 PM
Post #1


Member [Level 1]
****

Group: Members
Posts: 65
Joined: 16-November 04
Member No.: 2,306



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
Go to the top of the page
 
+Quote Post
no9t9
post Dec 31 2004, 02:26 PM
Post #2


Privileged Member
*********

Group: Members
Posts: 773
Joined: 4-November 04
Member No.: 2,118



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Open Office Vs Microsoft(42)
  2. [help] Java Script: Window.open(8)
  3. Open Source Web Design(50)
  4. I Wanted To Close My Account.(7)
  5. Ferentus(6)
  6. Open Php Page From Another Server(7)
  7. Javascript Close Window(12)
  8. Fp2003 - Tables(7)
  9. Files With Mdf Extension(6)
  10. How To Open A .daa File(39)
  11. Informix To Sql Server (or How To Open .unl Files)(2)
  12. Aef - Free Forum Software(8)
  13. A List Of Great Free Software(9)
  14. Australian Open 2008(2)
  15. Open_basedir Issue(6)
  1. Open Port 80?(3)
  2. Open Source Movement(2)
  3. Getting Started With Mysql(2)
  4. How To: Html Tables.(8)
  5. Do You Close The Javascript?(4)
  6. Open Grave Chili(1)
  7. How Do I Close My Hosting Account?(1)
  8. Cannot Open Display - Error(2)
  9. Free Icon Sets For Open Source Projects(0)
  10. Harddrive "open With..." Problem(1)
  11. How To Open Multiple Tabs?(6)
  12. Open Program Copyrights For Third World Nations(7)
  13. Close Own Topics(4)


 



- Lo-Fi Version Time is now: 6th September 2008 - 06:45 PM