HTML - Need Help With Collapse Menu Code
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 Similar TutorialsWhat 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. hi how to make a table element collapse? This 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 Alright, let me begin by saying that I am functionally retarded and have the most basic understanding of HTML. I don't know if it's against the rules or not to post HTML codes and get somebody to fix them for you, but I'm desperate. I usually steer clear of forums. The code that is giving me trouble is below _________________________________________________________________ <li><a href='http://www.twitter.com/'>Twitter</a> <ul class='children'> </li> <li><a href='#'>Top News</a> <ul class='children'> <li><a href='http://www.twitter.com/'>User 1</a></li> <li><a href='http://www.twitter.com/'>User 2</a></li> <li><a href='http://www.twitter.com/'>User 3</a></li> </ul> <li><a href='#'>General Infornation</a> <ul class='children'> </li> <li><a href='http://www.twitter.com/'>User 4</a></li> <li><a href='http://www.twitter.com/'>User 5</a></li> <li><a href='http://www.twitter.com/'>User 6</a></li> <li><a href='http://www.twitter.com/'>User 7</a></li> <li><a href='http://www.twitter.com/'>User 8</a></li> <li><a href='http://www.twitter.com/'>User 9</a></li> <li><a href='http://www.twitter.com/'>User 1</a></li> <li><a href='http://www.twitter.com/'>User 10</a></li> <li><a href='#'>User 12</a></li> </ul> <li><a href='#'>Minor League Reports</a> <ul class='children'> </li> <li><a href='#'>User 11</a></li> <li><a href='http://www.twitter.com/'>Adam Nightingale</a></li> <li><a href='#'>User 12</a></li> </ul> <li><a href='#'>In-Game Reports</a> <ul class='children'> </li> <li><a href='http://www.twitter.com/'>User 13</a></li> <li><a href='http://www.twitter.com/'>User 10</a></li> </ul> <li><a href='#'>Game Recaps</a> <ul class='children'> </li> <li><a href='http://www.twitter.com/'>User 13</a></li> <li><a href='http://www.twitter.com/'>User 10</a></li> </ul> _________________________________________________________________ It's a code for a menu and I had a different one of this working before. What I wanted to do was to split the child menus into secondary child menus and select a user to contact from there. (it's a "Contact Us" menu) Any/all help is greatly appreciated. I have posted the code i use for a drop down menu bar but im looking to add a side menu to a link can anyone help? Code startSubmenu("connexion_b4","connexion_menu",111); submenuItem("07/08Gallery","http://www.banbridgerangersfc.co.uk/gallery.php","","connexion_plain"); submenuItem("06/07 Gallery","http://www.banbridgerangersfc.co.uk/galleryarchive.php","","connexion_plain"); submenuItem("Picture Board","http://www.banbridgerangersfc.co.uk/picture-board.php","","connexion_plain"); endSubmenu("connexion_b4"); Hi I'm trying to convince my work to change the design of their website. I have been told that if i can design something better, then they may consider it. However, I have no web building software here, and I have been told I am not able to work from home and get paid for it. I am able to write HTML and CSS in notepad, but I need a script to set up a horizonal drop down link menu. i.e. when you roll over the first link, it displays a list of options underneath... I need to have about 6-8 links with more options underneath. Can anybody suggest a reliable FREE script that I can use to demonstrate my idea?? LEROY How can I add submenus to the following code namely where I have Radio Shows? My web site is www.mcran.com Here is the code I am using: HTML Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script> $(document).ready(function(){ // hide #back-top first $("#back-top").hide(); $("#top-divider").hide(); // fade in #back-top $(function () { $(window).scroll(function () { if ($(this).scrollTop() > 100) { $('#back-top').show(); $('#top-divider').show(); } else { $('#back-top').hide(); $('#top-divider').hide(); } }); // scroll body to 0px on click $('#back-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 800); return false; }); }); }); </script> <div id="topbar"> <span style="float:left;padding-left:7px;"> <span style="width:30px;"><a href="#" id="back-top" onclick="return false;">BACK TO TOP</a></span> <span id="letters" style="display:none;"><span id="top-divider"> | </span><a href="#a">A</a> <a href="#b">B</a> <a href="#c">C</a> <a href="#d">D</a> <a href="#e">E</a> <a href="#f">F</a> <a href="#g">G</a> <a href="#h">H</a> <a href="#i">I</a> <a href="#j">J</a> <a href="#k">K</a> <a href="#l">L</a> <a href="#m">M</a> <a href="#n">N</a> <a href="#o">O</a> <a href="#p">P</a> <a href="#q">Q</a> <a href="#r">R</a> <a href="#s">S</a> <a href="#t">T</a> <a href="#u">U</a> <a href="#v">V</a> <a href="#w">W</a> <a href="#x">X</a> <a href="#y">Y</a> <a href="#z">Z</a> </span> </span> <span style="float:right;padding-right:7px;"> <a href="http://www.mcran.com" target="_self"><b>HOME</b></a> | <a href="http://www.mcran.com/bio-test-page.php" target="_self"><b>BIO</b></a> | <a href="http://www.mcran.com/contact.php" target="_self"><b>CONTACT</b></a> | <a href="http://www.mcran.com/interviews.php" target="_self"><b>INTERVIEWS</b></a> | <a href="http://www.mcran.com/playlistsshowtable.php" target="_self"><b>PLAYLISTS</b></a> | <a href="http://www.mcran.com/2010-2006showstable.php" target="_self"><b>RADIO SHOWS</b></a> | <a href="http://www.mcran.com/favorite-sites.php" target="_self"><b>RESOURCES</b></a> | </span> </div> I've just started learning HTML and I got one problem. I'm making a page that has link buttons on top of it. The buttons lead to different pages that I have created. All of these pages have the same buttons. Currently I have several html-files which all have the same section of code in them. I've programmed with Java before and something like that was never recommemded. You only had one code which was used as a "sub-program". Can something like this be done in HTML? I'm pretty new to web design, but I've started making drop down menus using HTML and CSS. I get annoyed that every time I want to change the menu I have to go and change it individually in every single page. I am wondering if there is a way to create the code in an external file and link it into my pages, so that if I want to make a change, I can do it from one central file and have the change appear on each individual page. Is this possible? How can I do this? Hey guys, After looking at multiple help sites, I've confirmed that there is something messed up in the current code I have that's preventing me from doing a simple jQuery + CSS dropdown menu. I have attached my files, HTML and CSS in all, just un-zip it and see if you can help me out! Thanks, ~C-Style~ P.S.: It's a bulky file because of the jQuery plugin I have inside. I am trying to get rid of the "You have to click to activate this function" mumbo jumbo for a site I am doing. I tried following these directions... http://www.adobe.com/devnet/activeco...devletter.html but am having a rough time getting it to work... here is my code. Code: <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','900','height','140','src','GoodDock','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','GoodDock' ); //end AC code </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="900" height="140"> <param name="movie" value="images/GoodDock.swf" /> <param name="quality" value="high" /> <embed src="images/GoodDock.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="900" height="140"></embed> </object></noscript> Hello, I'm new to this forum, so first, hello! Actually, I'm new to web design in general but have taken on the role at the church I work at because our old site was a mess. I downloaded some nice looking templates and have been using them as a foundation. The site is www.miamibc.com. If you go there and look at the header menu (home, about us, etc), I want to consolidate that menu some and add a drop down menu with more choices. Is there a way I can do this while keeping it looking the way it does now? If you need any more info from me, let me know. Thanks for your help! Ben 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 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. 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 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. okey so i have maken an image af the menu i would like to have but i cant seem to make it, i have tryede for a long time now and I need some help to make it the menu looks like the bellow image and have the hover effect as U can see an the 3th link, there is 3 links when U run the mouse over it.. the only thing i know i want about the menu about the code part is that it must not contain "px" only give it the size with "%", else U guys can do what ever U want to make it.... HOME Botton shall not have the hover Menu: Thanks for Ur help Hi, How can you create a menu that changes colors when you move over it with your mouse and where you can link other page's on. I only need to insert text if it can be something like a tabel that changes the colors not only the text but the background of text too . Can someone help me with thisone Thx I am very new to Html and everything that goes along with it. I have done ok so far trying to put a "Menu bar" up on the top of one of my games. Its not a traditional menubar. This is going to have a FB like button, a tweet button, and a Facebook button to my app fan page. when i do the like button and tweet button by them selves it looks fine. but when i try to add the Fan page button (that is basically an Anchor link) it goes all awry. here is the code I have <ul id="list-nav"> <div id="fb-root"></div> <script>(function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js#appId=116334528469376&xfbml=1"; d.getElementsByTagName('head')[0].appendChild(js); }(document));</script> <li><div class="fb-like" data-href="http://www.facebook.com/apps/application.php?id=146310492066325" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true" data-colorscheme="dark"></div></li> <li><a href="http://www.facebook.com/apps/application.php?id=146310492066325"> <img src='http://www.carboncopygames.com/files/facebook.png' /></a></li> <li><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.facebook.com/apps/application.php?id=146310492066325" data-text="Try Out AcroBlast on Facebook #flashgame" data-count="horizontal" data-via="doorsmaniac">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></li></script> </ul> you can see what it looks like here Sorry if I butchered this Thanks! |