Click to See Complete Forum and Search --> : Inserting an image into .js file


ivo
01-17-2004, 09:36 AM
Hi!

I have a .js file for my navigation menu. In the drop-down menu I want to replace cursor '>' with an image, let's say little arrow, which is in file "arrow.gif".
How can I do that?
Does it matter if it's arrow.gif or arrow.GIF?


// We've passed a 'greater-than' sign '>' as a popout indicator. Try an image...?
menu[1][0] = new Menu(true, '>', 0, 22, 80, defOver, defBack, 'itemBorder', 'itemText');
menu[1][1] = new Item('Utah Jazz', '#', '', defLength, 0, 0);
menu[1][2] = new Item('Andrei Kirilenko', '#', '', 40, 0, 6);

Pittimann
01-17-2004, 10:00 AM
Hi!

Not knowing, how the script constructs the menu and assuming that tags can be passed as an argument, I would say:

use arrow.gif, if the file really is called like that (all lower case); but you will have to replace the '>' with a full image tag with src="arrow.gif".

No guaranty, since I don't know your code...

Cheers - Pit

ivo
01-17-2004, 03:52 PM
Jeah I've tried that, but it didn't work. Here's the original code:

http://javascript.internet.com/navigation/cascading-menu.html

I put that code in a .js file except the following:
<style>
<!--

.itemBorder { border: 1px solid black }
.itemText { text-decoration: none; color: #FFFFFF; font: 12px Arial, Helvetica }

.crazyBorder { border: 2px outset #663399 }
.crazyText { text-decoration: none; color: #FFCC99; font: Bold 12px Arial, Helvetica }

-->
</style>

... which I put between <body> </body> tags and of course put requested functions inside the <body>.
It runs perfectly, but I want to change those '>' with some image. On that page is also an example of the code.

Pittimann
01-17-2004, 04:17 PM
Hi!

Example for the line, you posted with '>' in your first post (other lines like that will have to be treated accordingly):

menu[1][0] = new Menu(true, '<img src="arrow.gif" alt="&nbsp;open submenu&nbsp;" border=0>', 0, 22, 80, defOver, defBack, 'itemBorder', 'itemText');

That will do the job, if the rest of your code is ok...

Cheers - Pit

ivo
01-17-2004, 06:01 PM
Thank's a lot! It works!

Vielen dank :D

Ivo.