We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Dropdown Submenu Option
Topic Started: Jun 22 2012, 06:06 PM (712 Views)
serran
Member
[ * ]
Board Address: here
Board Software: Zetaboards
Description:

I found a code earlier to rename links/customize the submenu , but cannot seem to find a code for a drop down to work nicely with it.

Code Mentioned Above


I am trying to find a way to make it so when you hover over "Information" it can take you to other pages (drop down menu)
I would like the appearance to remain the same, not a box with a submit button or where it looks awkward and out of place like the other coding I have found thus far.

I would really appreciate the help, I have come across other threads, but the don't seem to be what I am looking for.
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Quote:
 
<script type='text/javascript'>
//Drop Down Menu by Quozzo
var dpic = "http://z3.ifrm.com/static/1/pm.png"
var dmenu = [
["Links",""],
["LINK_NAME","LINK_URL"],
];
if(dpic){dpic="<img src='"+dpic+"'></img> "}
var listroll = ""
listroll+="<li id='dmenu'><a href='"+dmenu[0][1]+"'>"+dpic+dmenu[0][0]+"</a><ul>";
for(i=1;i<dmenu.length;i++){
listroll+="<li><a href='"+dmenu[1]+"'>"+dmenu[0]+"</a></li>";
};
listroll+="</ul></li>";
$('#top_menu').append(listroll);
</script>

Green highlighted text
Thats the Drop down box name

Yellow highlighted text
Thats an option in the drop down box

Pink highlighted text
The pink is the option Link

Just repeat this line to add more options
["LINK_NAME","LINK_URL"],

Example
Attached to this post:
Attachments: heklo1.png (63.46 KB)
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
use this as Ferby has used the quote tags which tries to parse some of it as BBCode which is why it looks italic
Code:
 
<script type='text/javascript'>
//Drop Down Menu by Quozzo
var dpic = "http://z3.ifrm.com/static/1/pm.png"
var dmenu = [
["Links","http://www.google.com"],
["Factions","http://rp-generations.co.cc/home/?c=22"],
["Ferbys Blog","http://rp-generations.co.cc/blog/main/3190419/"],
["Awards","http://rp-generations.co.cc/pages/awards/"],
];
var dpic = dpic ? "<img src='"+dpic+"'></img> " : "";
var listroll = ""
listroll+="<li id='dmenu'><a href='"+dmenu[0][1]+"'>"+dpic+dmenu[0][0]+"</a><ul>";
for(i=1;i<dmenu.length;i++){
listroll+="<li><a href='"+dmenu[i][1]+"'>"+dmenu[i][0]+"</a></li>";
};
listroll+="</ul></li>";
$('#top_menu').append(listroll);
</script>
You can use it mutliple times to add as many drop down menus as you like
Edited by Quozzo, Jun 23 2012, 08:02 PM.
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Quozzo
Jun 23 2012, 07:59 PM
use this as Ferby has used the quote tags which tries to parse some of it as BBCode which is why it looks italic
Code:
 
<script type='text/javascript'>
//Drop Down Menu by Quozzo
var dpic = "http://z3.ifrm.com/static/1/pm.png"
var dmenu = [
["Links","http://www.google.com"],
["Factions","http://rp-generations.co.cc/home/?c=22"],
["Ferbys Blog","http://rp-generations.co.cc/blog/main/3190419/"],
["Awards","http://rp-generations.co.cc/pages/awards/"],
];
var dpic = dpic ? "<img src='"+dpic+"'></img> " : "";
var listroll = ""
listroll+="<li id='dmenu'><a href='"+dmenu[0][1]+"'>"+dpic+dmenu[0][0]+"</a><ul>";
for(i=1;i<dmenu.length;i++){
listroll+="<li><a href='"+dmenu[i][1]+"'>"+dmenu[i][0]+"</a></li>";
};
listroll+="</ul></li>";
$('#top_menu').append(listroll);
</script>
You can use it mutliple times to add as many drop down menus as you like
I thought it looked italic, not just me then :facepalm:
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Enjoy forums? Start your own community for free.
« Previous Topic · Closed Requests · Next Topic »
Locked Topic