This (highlighted red):

Originally Posted by
stossell
Code:
var menu1=new Array()
menu1[0]='<"#">sub menu1</a>'
menu1[1]='<hr>'
menu1[2]='<"#">sub menu2</a>'
is not valid and should create, at the very least, a situation where the texts in green are not links. Furthermore, in all of what you have written in your post, there isn't a single valid link, let alone one with text. To create a link using an image with rollover, this syntax may be employed:
Code:
<a href="somepage.htm" [include events or any valid link attributes here]><img src="some.jpg" onmouseover="rolloverfunction(this, 'someother.jpg');" onmouseout="rolloverfunction(this, 'some.jpg');"></a>
The only difference, if you use the above in a menu array, is that you must escape the single quotes:
Code:
menu1[0]='<a href="somepage.htm" [include events or any valid link attributes here]><img src="some.jpg" onmouseover="rolloverfunction(this, \'someother.jpg\');" onmouseout="rolloverfunction(this, \'some.jpg\');"></a>'
The rollover function could look like this:
Code:
<script type="text/javascript">
function rolloverfunction(el, img){
el.src=img
}
</script>
Bookmarks