Below is an example of what I need to do. I have small gifs of 200 of my art paintings and 5 transparent gifs of 5 different picture frame styles. I want to overlay the picture frame gif over the gif of the painting just like they do on the below site so that potential buyers of art can see various picture frame styles.
Click on example below, and when you get to the page just click on a picture frame style and see what happens:
[url]http://www.overstockart.com/poofmaha19co.html#order
Do I need to make an image of each painting with each picture frame style (5X200=1000) (I hope not!), or is there some way through scripting to overlay just the transparent picture frame part on the image?
If anyone knows of a way or you have a snippet pls let me know.
[CODE]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
var zxcThumbDirectory='StdImages';
var zxcMainDirectory='StdImages';
var zxcImg;
var zxcImgAry=new Array();
var zxcImage=new Array();
var zxcCnt=-1;
function zxcInit(){
zxcImg=document.getElementById('ThumbNails').getElementsByTagName('IMG');
for (zxc0=0;zxc0<zxcImg.length;zxc0++){
zxcImgAry[zxc0]=zxcImg[zxc0];
zxcImg[zxc0].nu=zxc0-1;
zxcImg[zxc0].onclick=function(){ zxcCnt=this.nu; zxcSSFwd(); }
}
}
function zxcSSBack(){
zxcCnt--;
if (zxcCnt<0){ zxcCnt=zxcImg.length-1; }
zxcLoad();
}
function zxcSSFwd(){
zxcCnt++;
if (zxcCnt==zxcImg.length){ zxcCnt=0; }
zxcLoad();
}
function zxcLoad(){
if (zxcImage[zxcCnt]){
zxcDoIt();
}
else {
document.getElementById('zxcMessage').innerHTML='Please Wait';
zxcImage[zxcCnt]=new Image();
zxcImage[zxcCnt].onload=function(){ document.getElementById('zxcMessage').innerHTML=''; zxcDoIt(); }
zxcImage[zxcCnt].src=zxcImg[zxcCnt].src.replace('zxcThumbDirectory','zxcMainDirectory');
}
}
function zxcDoIt(){
document.getElementById('zxcMainImg').src=zxcImage[zxcCnt].src;
}
//-->
</script></head>
<body onload="zxcInit()" >
<div style="position:relative;top:0px;left:0px" >
<img src="http://www.vicsjavascripts.org.uk/StdImages/Five.gif" width=220 height=220 style="position:absolute;top:0px;left:0px;" >
<img id="zxcMainImg" src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width=200 height=200 style="position:absolute;top:10px;left:10px;" >
</div>
<table border=1 style="position:relative;top:230px;left:0px" >
<tr>
<td width=70 align="center" ><img src="http://www.vicsjavascripts.org.uk/StdImages/Left1.gif" width=20 height=20 onclick="zxcSSBack();" ></td>
<td id="zxcMessage" width=60 align="center" style="font-Size:12px;" ></td>
<td width=70 align="center" ><img src="http://www.vicsjavascripts.org.uk/StdImages/Right1.gif" width=20 height=20 onclick="zxcSSFwd();" ></td>
</tr>
</table>
<table id="ThumbNails" style="position:relative;top:260px;left:0px">
<tr>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/Zero.gif" width=50 height=50 ></td>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/One.gif" width=50 height=50 ></td>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/Two.gif" width=50 height=50 ></td>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/Three.gif" width=50 height=50 ></td>
</tr>
<tr>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/Four.gif" width=50 height=50 ></td>
<td></td>
<td width="50"><img src="http://www.vicsjavascripts.org.uk/StdImages/Two.gif" width=50 height=50 ></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
[/CODE]
Below is an example of what I need to do. I have small gifs of 200 of my art paintings and 5 transparent gifs of 5 different picture frame styles. I want to overlay the picture frame gif over the gif of the painting just like they do on the below site so that potential buyers of art can see various picture frame styles.
Click on example below, and when you get to the page just click on a picture frame style and see what happens:
http://www.overstockart.com/poofmaha19co.html#order
Do I need to make an image of each painting with each picture frame style (5X200=1000) (I hope not!), or is there some way through scripting to overlay just the transparent picture frame part on the image?
If anyone knows of a way or you have a snippet pls let me know.[/QUOTE]
Basically, line a frame (any frame) up on your page so it looks like the painting is in the frame. Then use javascript to change the source of the frame via basic image swapping.[/QUOTE]
[CODE]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
pic3.jpg
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
var zxcThumbDirectory='Thumbs';
var zxcMainDirectory='';
var zxcImg;
var zxcImgAry=new Array();
var zxcImage=new Array();
var zxcCnt=-1;
function zxcInit(){
zxcImg=document.getElementById('ThumbNails').getElementsByTagName('IMG');
for (zxc0=0;zxc0<zxcImg.length;zxc0++){
zxcImgAry[zxc0]=zxcImg[zxc0];
zxcImg[zxc0].nu=zxc0-1;
zxcImg[zxc0].onclick=function(){ zxcCnt=this.nu; zxcSSFwd(); }
}
}
function zxcSSBack(){
zxcCnt--;
if (zxcCnt<0){ zxcCnt=zxcImg.length-1; }
zxcLoad();
}
function zxcSSFwd(){
zxcCnt++;
if (zxcCnt==zxcImg.length){ zxcCnt=0; }
zxcLoad();
}
function zxcLoad(){
if (zxcImage[zxcCnt]){
zxcDoIt();
}
else {
// document.getElementById('zxcMessage').innerHTML='Please Wait';
zxcImage[zxcCnt]=new Image();
zxcImage[zxcCnt].onload=function(){ zxcDoIt(); }
zxcImage[zxcCnt].src=zxcImg[zxcCnt].src.replace(zxcThumbDirectory,zxcMainDirectory);
}
}
function zxcDoIt(){
document.getElementById('zxcMainImg').src=zxcImage[zxcCnt].src;
document.getElementById('zxcFrame').width=document.getElementById('zxcMainImg').width+100;
document.getElementById('zxcFrame').height=document.getElementById('zxcMainImg').height+100;
document.getElementById('zxcFrame').style.top=(parseInt(document.getElementById('zxcMainImg').style.top)-50)+'px';
document.getElementById('zxcFrame').style.left=(parseInt(document.getElementById('zxcMainImg').style.left)-50)+'px';
}
//-->
</script></head>
<body onload="zxcInit()" >
<div style="position:relative;top:60px;left:400px" >
<img id="zxcFrame" src="frame1.jpg" width=220 height=220 style="position:absolute;top:0px;left:0px;" >
<img id="zxcMainImg" src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" style="position:absolute;top:0px;left:0px;" >
</div>
<table id="ThumbNails" style="position:relative;top:260px;left:0px">
<tr>
<td width="50"><img src="pic3.jpg" height=50 width=65 ></td>
</tr>
</table>
<table style="position:relative;top:50px;left:0px" >
<tr>
<td><img src="frame1.jpg" height=50 width=75 onclick="document.getElementById('zxcFrame').src='frame1.jpg';"></td>
<td><img src="frame2.jpg" height=50 width=75 onclick="document.getElementById('zxcFrame').src=this.src;"></td>
<td><img src="frame3.jpg" height=50 width=75 onclick="document.getElementById('zxcFrame').src=this.src;"></td>
<td> </td>
</tr>
</table>
</body>
</html>
[/CODE]
0.1.9 — BETA 5.16