Sven33
06-05-2007, 07:33 AM
Alright, first off, I have an osCommerce site. I have some basic perl/html experience...but I'm not too familiar with php.
What I'm looking to do is to have a different image appear when the user scrolls over each part of the menu bar. For example, the Home would be highlighted when the user scrolls over.
Here is the JavaScript I put in:
<html>
<head>
<script type="text/javascript">
function mouseOver()
{
document.b1.src ="m11on.gif"
}
function mouseOut()
{
document.b1.src ="m11.gif"
}
</script>
</head>
Now, here is where I'm having problems...the HTML part. I cannot figure out how to properly call the functions. Here are the first two menu links...the first one I have added what I thought was needed, and the second one is what was originally there:
<table cellspacing=0 cellpadding=0>
<tr><td><a href=<?=tep_href_link('index.php')?>target=_blank><img src=images/m11.gif name=b1 width=144 height=37 border=0 onmouseover=mouseOver() onmouseout=mouseOut()></a><a href=<?=tep_href_link('products_new.php')?>><img src=images/m12.gif width=139 height=37 border=0></a>
All throughout the document there are no quotes (like width="144")...but since they are using a single quote to call on phplink, would I need it with javascript?
Any help would be greatly appreciated.
Thanks
What I'm looking to do is to have a different image appear when the user scrolls over each part of the menu bar. For example, the Home would be highlighted when the user scrolls over.
Here is the JavaScript I put in:
<html>
<head>
<script type="text/javascript">
function mouseOver()
{
document.b1.src ="m11on.gif"
}
function mouseOut()
{
document.b1.src ="m11.gif"
}
</script>
</head>
Now, here is where I'm having problems...the HTML part. I cannot figure out how to properly call the functions. Here are the first two menu links...the first one I have added what I thought was needed, and the second one is what was originally there:
<table cellspacing=0 cellpadding=0>
<tr><td><a href=<?=tep_href_link('index.php')?>target=_blank><img src=images/m11.gif name=b1 width=144 height=37 border=0 onmouseover=mouseOver() onmouseout=mouseOut()></a><a href=<?=tep_href_link('products_new.php')?>><img src=images/m12.gif width=139 height=37 border=0></a>
All throughout the document there are no quotes (like width="144")...but since they are using a single quote to call on phplink, would I need it with javascript?
Any help would be greatly appreciated.
Thanks