HTML - Expand/collapse Code
What is the HTML code for expanding and collapsing the contents, when clicking on a text, on a page?
Just a plain and quick code for this option. Thank you very much. Similar TutorialsThis is frustrating, I'm looking for that code, working in IE and Firefox. Please help! Hi, i enclose the zip file, where are some files. If you click on 1start.html (best viewed in IE) and than click on "group1" and on "1.general1" it right frame should appear the content. So far so good. Later when I want to show/hide or collapse/expand the content and I click on the icon, something doesn't work. Can anyone pleease look in this code and tell me what's wrong. I seem not to know what i'm doing wrong. thank you all Hello, i found this code Code: <!-- Collapsible Menu Script. Created by Kyle Edwards. Please keep this notice intact. --> <!-- Below is the code for the hyperlinks that expand and collapse the menus. You need to do the following for each menu: 1. Create hyperlink code that looks like this: <a href="#" onclick="collapse_menu(menu1, 0)">The value of the link goes here.</a><br> Note: Change menu1 to the name of the menu, and change 0 to the number of the menu. Note: 0 is the number of the FIRST menu. 2. After each hyperlink, type in code that looks like this: <span id="menu1"></span> Note: Change "menu1" to the name of the menu. 3. Follow the instructions inside the <script> tags. They follow //'s. --> <p> <a href="#" onclick="collapse_menu(menu1, 0); return false">Menu 1</a><br> <span id="menu1"></span> <a href="#" onclick="collapse_menu(menu2, 1); return false">Menu 2</a><br> <span id="menu2"></span> <script language="javascript"> //Collapsible Menu Script. //Created by Kyle Edwards. //Please keep this notice intact. //This defines the arrays that contain info about the menus. Do NOT edit. var on_off=new Array(); var menu_code=new Array(); //Below, define number_of_menus. It should be equal to the number of menus you have. number_of_menus=2; //Here we define the code for the menus. Inside the quotation marks, type in the value of each option. //Note: After each option, you need to put a <br> tag. //Note: If you want to indent the options, type for each space of indentation. //and a </blockquote> tag at the end. //Example: " Option 1<br> Option 2<br>" //This puts two spaces at the beginning of each option. menu_code[0]="Option 1<br>Option 2<br>Option 3<br>"; menu_code[1]="Option 1<br>Option 2<br>Option 3<br>"; //Everything below this notice is the code that expands and collapses the menus. Do NOT edit. for (loop=0; loop<number_of_menus; loop++){ on_off[loop]=0; } function collapse_menu(menu_id, menu_number){ if (on_off[menu_number]==0){ menu_id.innerHTML=menu_code[menu_number]; on_off[menu_number]=1; }else{ menu_id.innerHTML=""; on_off[menu_number]=0; } } </script> It's exactly that kind of Code i need, i dont want any more Features on my Colapse Box. The only problem i got is that if i try to add a link for an Option, the Colapse Box dont work anymore. Hope you can help me hi how to make a table element collapse? I want to know how do we expand a row when mouse moves over that particular row?and moves back when moves out of it Is this possible with event handlers ???? Can someone help me ? I have a table on a site and I want, by clicking a button, to expand the table down then, by pushing the button again, or other button, to return to its initial size. Thanx. Hi all, I have a requirement to implement expand/collapseALL......... To tell in Detail....... i have 3 sections with expand/collapse in each section...... which expands their own sections......which is working perfectly for me . Then I have one more expandAll/CollapseAll at the top which is suppose to expands or collapse all the 3 sections child elements... Here is the requirement: Home ExpandAll | Collapse All [this is the one which is not working ] -------------------------------------------------------------------------------- Expand | Collapse Block 1 subBlock1.1 subBlock1 Block1.2 subBlock2 subBlock2 subBlock2 Block1.3 subBlock3 subBlock3 -------------------------------------------------------------------------------- Expand | Collapse Block2.1 subBlock1 subBlock1 subBlock1 Block2.2 subBlock2 Block3.1 subBlock3 subBlock3 -------------------------------------------------------------------------------- Expand | Collapse Block3.1 Any ideas please let me know............. Thankyou. regards, radhika. Hi I am creating a website template for a content management system, so i need to ensure that the content area can vertically stretch to any height, But i am currently having some trouble with the tables. I was wondering if anyone has a solution that would allow the content area to stretch without showing the grey background behind the surrounding images, as shown in the screenshot. The bottom row can be extended without issue, but by default when content is added to the content area its the middle row that is extending. How can i stop this? Also i need to centre both the tables, but one is an absolute div. Is there someway i can centre these but ensure that both tables are always aligned on top of each other? Thanks in advance for your help. HTML Code: <html> <head> <meta http-equiv="Content-Language" content="en-au"> <title>NewcastleRoofingWebsite1024x768</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body bgcolor="#C0C0C0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (NewcastleRoofingWebsite1024x768.psd) --> <div > <table id="Table_01" width="1015" height="761" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="12"> <img src="images/index_01.jpg" width="1015" height="229" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="images/index_02.jpg" width="282" height="47" alt=""></td> <td> <img src="images/index_03.jpg" width="116" height="36" alt=""></td> <td rowspan="2"> <img src="images/index_04.jpg" width="2" height="47" alt=""></td> <td> <img src="images/index_05.jpg" width="117" height="36" alt=""></td> <td rowspan="2"> <img src="images/index_06.jpg" width="2" height="47" alt=""></td> <td> <img src="images/index_07.jpg" width="117" height="36" alt=""></td> <td rowspan="2"> <img src="images/index_08.jpg" width="2" height="47" alt=""></td> <td> <img src="images/index_09.jpg" width="117" height="36" alt=""></td> <td rowspan="2"> <img src="images/index_10.jpg" width="2" height="47" alt=""></td> <td> <img src="images/index_11.jpg" width="119" height="36" alt=""></td> <td rowspan="2"> <img src="images/index_12.jpg" width="139" height="47" alt=""></td> </tr> <tr> <td> <img src="images/index_13.jpg" width="116" height="11" alt=""></td> <td> <img src="images/index_14.jpg" width="117" height="11" alt=""></td> <td> <img src="images/index_15.jpg" width="117" height="11" alt=""></td> <td> <img src="images/index_16.jpg" width="117" height="11" alt=""></td> <td> <img src="images/index_17.jpg" width="119" height="11" alt=""></td> </tr> <tr> <td> <img src="images/index_18.jpg" width="10" height="9" alt=""></td> <td colspan="11" rowspan="2"> <img src="images/index_19.jpg" width="1005" height="484" alt=""></td> </tr> <tr> <td> <img src="images/index_20.jpg" width="10" height="475" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="272" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="116" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="2" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="117" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="2" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="117" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="2" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="117" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="2" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="119" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="139" height="1" alt=""></td> </tr> </table> <p> </p> <div style="position: absolute; width: 1020px; height: 100%; z-index: 1; top: 288px; left:0" id="layer2"> <table id="Table_01" width="1015" height="477" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="50" colspan="2"> </td> <td colspan="5"> <img src="images/index_05.png" width="806" height="50" alt=""></td> <td> </td> </tr> <tr> <td height="257" colspan="2"> </td> <td colspan="2" background="images/index_08.png" height="257"> </td> <td rowspan="2" bgcolor="#FFFFFF"> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> <p> <p> </td> <td colspan="2" background="index_10.png" height="257"> </td> <td height="257"> </td> </tr> <tr> <td colspan="3" background="index_12.png"> <p>h</td> <td background="images/index_13.png"> </td> <td background="images/index_14.png"> </td> <td colspan="2" background="index_15.png"> </td> </tr> <tr> <td height="41" colspan="2"> <img src="images/index_16.png" width="96" height="41" alt=""></td> <td colspan="5"> <img src="images/index_17.png" width="806" height="41" alt=""></td> <td> <img src="images/index_18.png" width="113" height="41" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="10" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="86" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="33" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="9" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="716" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="9" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="39" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="113" height="1" alt=""></td> </tr> </table></div></div> <!-- End ImageReady Slices --> </body> </html> This isn't really a problem but just wanted to learn how to make an image expand or get bigger onmouseover. You can see what i mean by going to these website's. one is for a video and one is for a image. http://www.appstorehq.com/htmleditor...hone-63962/app Put your mouse over the screenshots. http://videocopilot.net/tutorials/ Put your mouse over the screenshots. Hello I'm new to HTML Now straight to the point : I have a web page that looks too big when screen resolution is 1024x786 , but on the other pc (screen resolution 1280x1024 ) the same page looks too small and I have white spaces around it. I want my whole page with it's elements adapt to the browser window size and fit exactly to it ( I don't want to see that scrolling thing on the right or bottom ). You could just give me the link of the function/code I have to use. Here is my code if that helps. Code: <html> <title>AiiT</title> <body background="b.png" style="background-repeat:no-repeat; background-position:center center; width: 1024px;height:768px;"> <div style="background-image: url('1.png'); width:764px; height:557px; position: absolute; top: 12%; left: 50%; margin-left: -382px; text-align:center; "><div style="background-image: url('Tr.png'); background-repeat:no-repeat; position: relative; left:30px; top:30px;"><img src="Her.png" border="0" style="margin-top:10px;"><br><br> <a href="en/"><img src="an.png" border="0"></a> <a href="lt/"><img src="li.png" border="0"></a><br><br><img src="Logo.png" border=0"></div></div> </body> </html> Help appreciated. why the table i have dont expand over browser borders when sum of td widths is bigger than screen width? How can i overcome this problem? Hey, I'm trying to write some code for expanding and concealing text You can see this in action at youtube when you click the (more) button to expand text. Suppose I had a heading: MyHeading and a body of text: MyTextHere How do I make it so that when you click MyHeading it makes MyTextHere (initially not visible) appear, and when you click MyHeading again, it makes MyTextHere disappear? Thanks Alot. Hello, I am a student and working on a simple first project. All I'm doing right now is writing my code in text edit, saving it as "test.html", and dragging and dropping the file onto Safari/Firefox to view my code. Everything works when I'm at my college's computer lab, but when I'm on my own mac notebook, the files load in the browser as my code. I've tried a variety of samples and checked my preferences, but I can't figure out what I'm doing wrong. Sample code I'm using - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Simple Link Example 2</TITLE> </HEAD> <BODY> <H1 ALIGN="CENTER">Creating Relative Reference Links</H> <HR> <P>Open <A HREF="practice1.html">Practice 1</A>.</P> <P> Open <A HREF="practice2.html">Practice 2</A>.</P> <P>Open <A HREF="practice3.html" TARGET="_blank"> Practice 3</A> in a new window.</P> </BODY> </HTML> Please help! I'm trying to wrap up an assignment and have been banging my head against the wall all night. Thanks! cordelia Hello! I have a blog on blogger and i want to make a c++ tutorial.. But every time i type "<iostream>" on post, when i see it, it is only "iostream". How can i make a code like the "[code]" from BBcode to cancel the compiling from HTML? Thanx! I was curious to find out, where can i find a cool looking shoutbox code where i can put on my message forum? Looking for some neat, and cozy with some advance options. Meaning, i would like to change the colors to match with my forum and stuff. Thanks. I have a website where I want to make a drop down menu that will bring you to different pages. It is a very basic, sort of old-fashioned website that relies entirely on html. What I'm trying to do is make a drop-down menu that will be used as navigation for a section of a website and I want to have it in each internally linked page in that section, but I'm going to be adding more pages to it over time so I want to be able to put the drop-down menu code in a separate text file and then substitute it into the pages that I make that the options in the menu link to and then just edit the code in the text file when I add another page so that I don't have to go back and edit the code every single individual page whenever I add a new one among them. Basically all I'm asking is how I can put html code in a text file and then substitute that code into an html page by referring to the file. Thanks in advance for any help. I know very basic html.. hyperlinks adding a few odds and ends but overall pretty basic html. Now what Im trying to do is a few things.. 1) Make an autosorting alphebetical list. (So if i add a new title I dont have to manually find the spot where it goes, it will sort if for me) 2) Make 2 colums wide. Here is the blog: http://kl-axxo-n.blogspot.com/ Hello i would really apreciate if some1 could help me with this kind of code : I have some thumbnails images and i want to play embed videos for each image, and the video to apears in a specific location .... If some1 could help thank you in advance Sorry for waste of time, completed myself |