Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Wiiplay123's Javascript Menu API
- // Usage: makeMenu(menu name, image link, image when mouse not over, image when mouse over);
- // Menu name is not repeated for each image.
- // Image link, image when mouse not over, and image when mouse over repeat.
- document.write("<script type=\"text/javascript\" src=\"./jquery.js\"></script>");
- var buttons = new Array();
- function makeMenu(menuname) {
- document.write("<table>");
- for (var i = 1; i < arguments.length; i = i + 3) {
- document.write("<tr><td><a href=\"" + arguments[i] + "\"><img id=\"" + menuname + String(i) + "\" src=\"" + arguments[i + 1] + "\"></img></a></td></tr>");
- button = menuname + String(i)
- $("#" + menuname + String(i)).mouseover(function(){
- this.src = buttons[this.id][2];
- });
- $("#" + menuname + String(i)).mouseout(function(){
- this.src = buttons[this.id][1];
- });
- buttons[menuname + String(i)] = new Array(menuname, arguments[i + 1], arguments[i + 2]);
- }
- document.write("</table>");
- }
Advertisement
Add Comment
Please, Sign In to add comment