Click to See Complete Forum and Search --> : Image in sliding menu
I need to add images to the sliding menu that I used here. http://www.infinitypages.com/menu I want to add an arrow that points down for the links that have sublinks. The external JavaScript code can be found at http://www.infinitypages.com/menu/menu/sliding_menu.js If anyone know how I can do this, I'd appreciate the help. Thanks.
Zach Elfers
12-06-2002, 11:16 AM
Instead of:
Link[0] = "0| Home";
for a link, do:
Link[0] = "0|<img src=image.gif>";
I did that to this script once back when I was using it. I think that's how I did it.
Thanks...That worked. I had put it in quotes like this - <img src="img.gif">. So once I removed those it worked. Unfortunetly, I ran across an even bigger problem. All items need to have submenus For example, say I want the scripts tab to be a link without any submenu (see http://www.infinitypages.com/menu) So, I don't know if anyone knows of a workaround for this. The code is not commented at all, so it makes it very hard to work with. But, if anyone know how to do this (or even a different script to do all this) I'd appreciate the help.
Zach Elfers
12-06-2002, 07:18 PM
Sorry about the quotes thing. I left them out of my post on purpose because I knew that they would interfere with the JavaScript quotes. You can add the quotes by doing \", but that doesn't really matter.
About the submenus... If you want to have a menu that DOESN'T have any submenus, just create a new Div and apply the same CSS formatting that you did to the submenus. Then line it up with those menus and make it a link. If you don't understand I will explain more.
P.S. Your menus submenus stick out a little to the right in IE 6.0, but look fine in IE 5.5
Zach Elfers
12-06-2002, 07:23 PM
Oh yeah... I don't know if you're interested in this, but you can stop the bottom menu from automatically opening when you load the page by putting:
startup(0);
at the bottom of the script. That should already exist as startup(4);.
No, no.. You were right about the quotes, what I had done was put it in quotes, thus messing up the script.
I'm not exactly sure what you mean. Are you talking about the .js or the .htm file? Also, using this meathod, will it still slide down with the rest of the menu if there is a submenu above it?
Zach Elfers
12-07-2002, 11:00 AM
You know how when you go to your page, the bottom menu (javascript) automattically opens up. Your can prevent this by going into the HTML file and finding the part where the menus are. Then there should be some JavaScript code. At the bottom of the code it should say startup(4); change that to startup(0);.
Now about the submenu that doesn't slide. I see what you mean. You will have to place these menus ABOVE the ones that slide, that way the menus don't slide over them.
There is also another way you could do this, but it might not work. When you name like, for example, the HOME menu, you put a 1 by it. After that menu you put 0's by the menus below. You will have to click the 1 menu for the 0 menus to come down. Try naming a menu 1 and give it a link, but don't add any 0 menus to it. Do you know what I mean?
Alright, I changed the startup(4) to startup(0) and that worked good.
It didn't work to just name a menu 0 and not give it any 1's. I think this is because the .js file isn't set to handle 0's as links. If I set them to handel links (at least the way that the original scripter did it) it causes all kinds of problems.
I think what I'm going to have to do is set it so you can also choose a 2 and this will be for the top level links. Just need to get some code to handle that then... I tried before and got it to work a little, but I don't really understand his code totally, so it didn't work that time. I guess I'll just try again. Last time I tried, it added all the top level links in as sub menus (ie. Scirpts had Scripts directly underneath it when you opened it.) Well I'll go work on it some more...
Well, my brother worked on the .js for a while, and I worked on the HTML and I think we got it pretty close. Take a look and let me know what you think. I tested it in IE6 and NS7 and it works in both of those. I don't know about anything else yet. Again, the link is http://www.infinitypages.com/menu