Replies Back to Article
Swap Trans Image
As the extension description already states, the transition effects only work in IE4+ on PC. But the swap itself should work in all browsers on all platforms.
Doesn't it?
Are there any error messages? If so, what do they say?
I have installed the Swap Trans Image and it works very well with UD4. I am creating a photography portfolio with it and wanted to use onClick instead of onMouseOver. Unfortunately when I tried this it didn't work very well. Sometimes it worked, other times it didn't.
Is there any reason why this wouldn't work?
Thanks,
Andrew
Hi Andrew,
No, it should work equally well with onMouseOver.
Can you show me an URL?
Regards, Marja
Thanks for your response and sorry it took me awhile to get back to you. You can visit the URL below for an example.
http://www.xcelco.on.ca/~aross/demo/image_swap5.html
This page works fine with onMouseOver, but when I replace it with onClick it doesn't work. I don't know if this matters, but none of the images are preloaded. I'm trying to avoid doing this so the page loads faster. That's also why I want to use onClick instead of onMouseOver.
Thanks again.
Hi Andrew,
Sorry for this delayed reply, but I just now saw your post.
I have tried using onClick in my example page, but it works just fine then.
You say you don't want to preload the images, but have you tried if that would make a difference? Does it work when you preload the images?
Because I do think that that is the cause of the problem.
Regards, Marja
Regards
Kenny
Hi,
Nice fade transition but as with the dreamweaver default behaviour, in IE for some reason when I use it with the onClick state across multiple images, some of the images disappear completely. Here's the code snippet below... very frustrating as suprisingly this works in NN4+ with no problems...
<a href="javascript:;" onClick="flvFSTI1('apage','images/case_01_on.gif',0,0,1,'bpage','images/case_02_off.gif',0,0,1,'cpage','images/case_03_off.gif',0,0,1,'dpage','images/case_04_off.gif',0,0,1,'epage','images/case_05_off.gif',0,0,1,1)">
Does this IE issue also occur when you specify a separate trigger for each image?
Eg. <a href="javascript:;" onClick="flvFSTI1('apage','images/case_01_on.gif',0,0,1);flvFSTI1('bpage','images/case_02_off.gif',0,0,1);flvFSTI1('cpage','images/case_03_off.gif',0,0,1);flvFSTI1('dpage','images/case_04_off.gif',0,0,1);flvFSTI1('epage','images/case_05_off.gif',0,0,1,1)">
Hi,
I have found a workaround that is compatible with all browsers and probably works for the standard swap image browser as well. Code below...
Basically if you move the onClick statement inside the href "" with javascript:; at the front it works fine. The url for the link looks stupid in the status bar but can't think of anything else that is cross browser compatible to solve this one.
<script language="javascript" type="text/javascript">
normal_apage = new Image();
normal_apage.src = "images/case_01_off.gif";
mouseover_apage = new Image();
mouseover_apage.src = "images/case_01_on.gif";
normal_bpage = new Image();
normal_bpage.src = "images/case_02_off.gif";
mouseover_bpage = new Image();
mouseover_bpage.src = "images/case_02_on.gif";
normal_cpage = new Image();
normal_cpage.src = "images/case_03_off.gif";
mouseover_cpage = new Image();
mouseover_cpage.src = "images/case_03_on.gif";
normal_dpage = new Image();
normal_dpage.src = "images/case_04_off.gif";
mouseover_dpage = new Image();
mouseover_dpage.src = "images/case_04_on.gif";
normal_epage = new Image();
normal_epage.src = "images/case_05_off.gif";
mouseover_epage = new Image();
mouseover_epage.src = "images/case_05_on.gif";
<!-- repeat the 4 lines above for any subsequent images. -->
function swap(){
if (document.images){
for (var x="0;"
x<swap.arguments.length;
x+=2) {
document[swap.arguments[x]].src = eval(swap.arguments[x+1] + ".src");
}
}
}
</script>
<a href="javascript:;swap('apage','mouseover_apage','bpage','normal_bpage','cpage','normal_cpage','dpage','normal_dpage','epage','normal_epage')">some link or image</a>
Hope this helps
Luv Sip
The only thing you're accomplishing here is that the swap images get preloaded.
If you check the 'Preload images' option in the DW dialog for Swap trans Image (and for the default Swap Image behavior as well), the images get preloaded as well.
Did you not check that option in the dialog then?
This works so well in IE. However doesnt work at all in firefox. It just displays the 2nd image without any fade?
Any ideas?
Al