P
peashoe
I need to create a javascript that not only changes a picture, but also
the link: here is an example of what I need www.myweddingfavors.com/
I'm working on this website and have it half done:
www.mygiftbasketideas.com - I also what the table to change color on
mouseover - this is the code I am using so far:
in the script.js
if (document.images)
{
image2= new Image(100,100);
image2.src="/store/images/P/romance.jpg";
image3= new Image(100,100);
image3.src="/store/images/P/welcome_baby_boy.jpg";
image4= new Image(100,100);
image4.src="/store/images/P/picnic.jpg";
image5= new Image(100,100);
image5.src="/store/images/P/vineyard.jpg";
image6= new Image(100,100);
image6.src="/store/images/P/european.jpg";
image7= new Image(100,100);
image7.src="/store/images/P/lasting.jpg";
image8= new Image(100,100);
image8.src="/store/images/P/birthday_celebrate.jpg";
image9= new Image(100,100);
image9.src="/store/images/P/patriotic.jpg";
image10= new Image(100,100);
image10.src="/store/images/P/tea.jpg";
image11= new Image(100,100);
image11.src="/store/images/P/thanks.jpg";
image12= new Image(100,100);
image12.src="/store/images/P/spa_pleasure.jpg";
}
function change1(picName,imgName)
{
if (document.images)
{
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;
}
}
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;
then on the HTML page:
<table width="600" border="1" bordercolor="#993333" cellspacing="0"
cellpadding="00">
<tr>
<th scope="col" align="left"><A href="#"><IMG alt=""
src="{$ImagesDir}/romance.jpg" name="pic1" border=0></A></th>
<th scope="col" valign="top">
<table height="100%" width="200" cellspacing="0" cellpadding="0"
border="1" background="/store/skin1/images/BACKGROUND.jpg"
bordercolor="#993333">
<tr><td width="200" height="30" align="left"><A
onMouseover="change1('pic1','image2')"
onMouseout="change1('pic1','image2')" title="Valentine Gifts"
rel="nofollow" href="/Valentine-gift-basket.html">
<div class="menu_text"> Valentine
Gifts</div>
</A></td></tr>...........
How do I do both?
Thanks in advance
Lisa
the link: here is an example of what I need www.myweddingfavors.com/
I'm working on this website and have it half done:
www.mygiftbasketideas.com - I also what the table to change color on
mouseover - this is the code I am using so far:
in the script.js
if (document.images)
{
image2= new Image(100,100);
image2.src="/store/images/P/romance.jpg";
image3= new Image(100,100);
image3.src="/store/images/P/welcome_baby_boy.jpg";
image4= new Image(100,100);
image4.src="/store/images/P/picnic.jpg";
image5= new Image(100,100);
image5.src="/store/images/P/vineyard.jpg";
image6= new Image(100,100);
image6.src="/store/images/P/european.jpg";
image7= new Image(100,100);
image7.src="/store/images/P/lasting.jpg";
image8= new Image(100,100);
image8.src="/store/images/P/birthday_celebrate.jpg";
image9= new Image(100,100);
image9.src="/store/images/P/patriotic.jpg";
image10= new Image(100,100);
image10.src="/store/images/P/tea.jpg";
image11= new Image(100,100);
image11.src="/store/images/P/thanks.jpg";
image12= new Image(100,100);
image12.src="/store/images/P/spa_pleasure.jpg";
}
function change1(picName,imgName)
{
if (document.images)
{
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;
}
}
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;
then on the HTML page:
<table width="600" border="1" bordercolor="#993333" cellspacing="0"
cellpadding="00">
<tr>
<th scope="col" align="left"><A href="#"><IMG alt=""
src="{$ImagesDir}/romance.jpg" name="pic1" border=0></A></th>
<th scope="col" valign="top">
<table height="100%" width="200" cellspacing="0" cellpadding="0"
border="1" background="/store/skin1/images/BACKGROUND.jpg"
bordercolor="#993333">
<tr><td width="200" height="30" align="left"><A
onMouseover="change1('pic1','image2')"
onMouseout="change1('pic1','image2')" title="Valentine Gifts"
rel="nofollow" href="/Valentine-gift-basket.html">
<div class="menu_text"> Valentine
Gifts</div>
</A></td></tr>...........
How do I do both?
Thanks in advance
Lisa