devshb
Senior Member
United Kingdom
1904 Posts |
Posted - June 10 2004 : 15:08:54
|
I think there's probably quite a few ways of doing that, and the option suggested above would definitely work too. you can create a generic javascript function to do image-swaps, and then call that in your extended-desc value as suggested above, or....
you could change the template to call that javascript function and embed the [pother1] fields etc in that function call.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
|
|
JNCRacing
Starting Member
13 Posts |
Posted - June 12 2004 : 16:02:17
|
I've been working on this and hopefully someone will be able to tell me why this isn't working...
i'm using tmp_product3.htm and everything is showing up the way it should just not the swaps...
Here is the code:
<script language="javascript">
<!-- hide script from old browsers
window.onerror = null;
var netscape = 0; var goodIE = 0; browserName = navigator.appName.substring(0,8); browserVer = parseFloat(navigator.appVersion); if (browserName == "Netscape" && browserVer >= 3) { netscape = 1; } if (browserName == "Microsof" && browserVer >= 4) { goodIE = 1; } // end error trapping code
if (netscape || goodIE) {
pic1 = new Image(250,300); pic1.src = "[extendedimage]"; pic2 = new Image(250,300); pic2.src = "[pother4]"; pic3 = new Image(250,300); pic3.src = "[pother5]";
a1 = new Image(83,100); a1.src = "[pother2]"; a2 = new Image(83,100); a2.src = "[pother2]"; b1 = new Image(83,100); b1.src = "[pother3]"; b2 = new Image(83,100); b2.src = "[pother3]"; }
function hiLite(imgDocID, imgObjName, imgDocID2, imgObjName2) { if (netscape || goodIE) { document.images[imgDocID].src = eval(imgObjName + ".src"); document.images[imgDocID2].src = eval(imgObjName2 + ".src");
}}
//end hiding --> </script>
in the cell that contains the default large image:
<img src="[extendedimage]" name="pic" alt="[cname]" height=300 width=250>
then on the place where the small images go:
<td width="172"><div align="center"><a href="" onMouseOver="hiLite('pic','pic2','a','a2'); window.status='Button 1';return true;" onMouseOut="hiLite('pic','pic1','a','a1'); window.status='';return true;" onclick="window.focus()"><img SRC="[pother2]" NAME="a" ALT="[cname]" BORDER=0 height=100 width=83></a> <a href="" onMouseOver="hiLite('pic','pic3','b','b2'); window.status='Button 2';return true;" onMouseOut="hiLite('pic','pic1','b','b1'); window.status='';return true;" onclick="window.focus()"><img SRC="[pother3]" NAME="b" ALT="[cname]" BORDER=0 height=100 width=83></a></td>
To view this in action:
http://www.made-online.com/shopexd.asp?id=32
Thanks...
Edited by - jncracing on June 12 2004 18:33:58
Edited by - jncracing on June 12 2004 18:51:41
Here's an update:
I took the javascript portion out of the tmp_product3.htm file and put it into the head of shoppage_header.htm. It's now trying to swap images but its still not quite right so if anyone can help me i'd really appreciate it.
Thanks
Edited by - jncracing on June 13 2004 00:59:01 |
|
|