Is is possible to use a switch menu, but instead of using images, you can use text?
Edited by Lµke (Forum Moderator): Thread Moved from Website Designing. Please post in the correct section next time, Thanks.

Is is possible to use a switch menu, but instead of using images, you can use text?
Edited by Lµke (Forum Moderator): Thread Moved from Website Designing. Please post in the correct section next time, Thanks.
Last edited by Lµke; 18-01-2007 at 10:21 PM.
I don't get what you're saying.
Change to what?Code:<img src="img.PNG" onclick="SwitchMenu('sub1')" width="129" height="17"> <span class="submenu" id="sub1"><font size="1" face="Verdana">
Take out the image code and add a text tag (i dunno???) instead...
If that isnt right i cannot remember but i did it once in dreamweaver using the one of DD, there is a text based one on there somewhere?
Last edited by Recursion; 18-01-2007 at 09:29 PM.
Dreamweavers Auto-Coding sucks.
Use this code:
Code:<head> <style type="text/css"> .menutitle{ cursor:pointer; margin-bottom: 5px; background-color:#ffffff; color:#000000; width:140px; padding:2px; font-style:verdana; text-align:left; font-weight:bold; /*/*/border:0px solid #000000;/* */ } .submenu{ margin-bottom: 0.5em; } </style> <script type="text/javascript"> var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc) var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only if (document.getElementById){ document.write('<style type="text/css">\n') document.write('.submenu{display: none;}\n') document.write('</style>\n') } function SwitchMenu(obj){ if(document.getElementById){ var el = document.getElementById(obj); var ar = document.getElementById("masterdiv").getElementsByTagName("span"); if(el.style.display != "block"){ for (var i=0; i<ar.length; i++){ if (ar[i].className=="submenu") ar[i].style.display = "none"; } el.style.display = "block"; }else{ el.style.display = "none"; } } } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { offset += search.length end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function onloadfunction(){ if (persistmenu=="yes"){ var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname var cookievalue=get_cookie(cookiename) if (cookievalue!="") document.getElementById(cookievalue).style.display="block" } } function savemenustate(){ var inc=1, blockid="" while (document.getElementById("sub"+inc)){ if (document.getElementById("sub"+inc).style.display=="block"){ blockid="sub"+inc break } inc++ } var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid document.cookie=cookiename+"="+cookievalue } if (window.addEventListener) window.addEventListener("load", onloadfunction, false) else if (window.attachEvent) window.attachEvent("onload", onloadfunction) else if (document.getElementById) window.onload=onloadfunction if (persistmenu=="yes" && document.getElementById) window.onunload=savemenustate </script> </head> <body> <font face="Verdana" size="1" color="000000"> <!-- Keep all menus within masterdiv--> </font> <div id="masterdiv"> <div class="menutitle" onclick="SwitchMenu('sub1')"> <font face="Verdana" size="1">Link</font></div> <font face="Verdana" size="1"> <span class="submenu" id="sub1"> - <a href="#"><span style="text-decoration: none">1</span></a><br> - <a href="#"><span style="text-decoration: none">2</span></a><br> - <a href="#"><span style="text-decoration: none">3</span></a><br> - <a href="#"><span style="text-decoration: none">4</span></a> </span> </font> <div class="menutitle" onclick="SwitchMenu('sub2')"> <font face="Verdana" size="1">Link</font></div> <font face="Verdana" size="1"> <span class="submenu" id="sub2"> - <a href="#"><span style="text-decoration: none">1</span></a><br> - <a href="#"><span style="text-decoration: none">2</span></a><br> - <a href="#"><span style="text-decoration: none">3</span></a><br> - <a href="#"><span style="text-decoration: none">4</span></a> </span> </font> <div class="menutitle" onclick="SwitchMenu('sub3')"> <font face="Verdana" size="1">Link</font></div> <font face="Verdana" size="1"> <span class="submenu" id="sub3"> - <a href="#"><span style="text-decoration: none">1</span></a><br> - <a href="#"><span style="text-decoration: none">2</span></a><br> - <a href="#"><span style="text-decoration: none">3</span></a><br> - <a href="#"><span style="text-decoration: none">4</span></a> </span> </font> <div class="menutitle" onclick="SwitchMenu('sub4')"> <font face="Verdana" size="1">Link</font></div> <font face="Verdana" size="1"> <span class="submenu" id="sub4"> - <a href="#"><span style="text-decoration: none">1</span></a><br> - <a href="#"><span style="text-decoration: none">2</span></a><br> - <a href="#"><span style="text-decoration: none">3</span></a><br> - <a href="#"><span style="text-decoration: none">4</span></a> </span> </font> </div> </body>
Looking for a good desiner to design a social networking template.
PM me.
Ahhh,
I'll try that, that's just taken out the image and inserted font tags.
Worked a treat, thanks Chris.
Common Sense really.
Last edited by F32; 18-01-2007 at 09:51 PM.
Want to hide these adverts? Register an account for free!