By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,422 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

IE 6 swap image problem

P: 1
Hello,

i have a problem swapping images in ie6. Apart from this browser it works fine in every other.

Expand|Select|Wrap|Line Numbers
  1. function swapimg(str){
  2. if(str=="new"){
  3. document.getElementById("btn1").src="img1.png";
  4. }
  5.  
[HTML]<a href="#x" onclick=\"swapimg('new');show('fn','news')\" >

<img name="btn1" id="btn1" border="0" src="img2.png" width="86" height="27" align="absbottom"></a>

[/HTML]I ve tried removing the ancor and doing: <a href="javascript:swapimg('new');" .....
but nothing again

Any help is appreciated
Nov 15 '07 #1
Share this Question
Share on Google+
2 Replies


Markus
Expert 5K+
P: 6,050
Hello,

i have a problem swapping images in ie6. Apart from this browser it works fine in every other.

function swapimg(str){
if(str=="new"){
document.getElementById("btn1").src="img1.png";
}

<a href="#x" onclick=\"swapimg('new');show('fn','news')\" >

<img name="btn1" id="btn1" border="0" src="img2.png" width="86" height="27" align="absbottom"></a>

I ve tried removing the ancor and doing: <a href="javascript:swapimg('new');" .....
but nothing again

Any help is appreciated
Ok, the only thing i had to change was the last curly bracket.

Don't know if you missed that off when copying and pasting it here or what...

But yeh, that's all :)
Nov 15 '07 #2

acoder
Expert Mod 15k+
P: 16,027
If that wasn't the problem, maybe the PNG image has alpha transparency. If so, it's not supported in IE6 and was fixed in IE7.
Nov 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.