Forum Moderators: open

Message Too Old, No Replies

SwapImage probs, works on Mac not PC

         

JennyNewton

1:37 pm on May 30, 2004 (gmt 0)

10+ Year Member



I've built a site in Dreamweaver but I'm having probs with getting some of the swapimage scripts to work. Basically it seems to work ok on Macs but everyone who has viewed it on a PC has had problems. I have a row of thumbnail images at the bottom of the page, and when someone clicks on one, the main image on the page changes to a large version of the thumbnail. When PC users click on the thumbnail, nothing happens - the large image does not swap like it should. I'm very much a beginner so I'm not sure how clearly I've explained the problem, but I'd be very grateful if someone could point me in the right direction! Not too good at html but I think this is the bit of code that Dreamweaver kindly wrote for me:

<a href="javascript:;" onClick="MM_swapImage('imageback','','oneofusfront.jpg',0)"><img src="minionefront.jpg" width="48" height="48" border="0"></a></td>

Hope that makes sense! Thanks for reading!

Rambo Tribble

2:04 pm on May 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is just a fragment of the code. The piece you have posted only calls the function, MM_swapImage(). The body of the function should be in the head of the document, contained within <script> tags. The function in question should look something like:

function MM_swapImage(varNam1,varNam2,etc.~){
//lines of code here;
}

I think we'll need to see that function to proceed. This should, actually, be a fairly simple bit of code, but products like Screamweaver are known to make the simple complex. (Is their's a government operation?)

MichaelBluejay

6:54 pm on May 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Jenny, I hear ya, I design on my Mac and frequently everything looks and works fine except it doesn't work on Windows. I had to break down and get a Windows machine and put it next to my Mac so I can test my pages.

Rambo is right, we need to see more code, but in the meantime here's a good tip I've found for debugging naughty JavaScript: In Internet Explorer turn on the option to Show Scripting Errors and then try out your page in IE instead of Safari. IE will then show you the JavaScript errors when you try to run the page, and they often provide valuable clues about what's wrong.

JennyNewton

7:44 pm on May 30, 2004 (gmt 0)

10+ Year Member



Thanks for the replies, I'll definitely give that last suggestion a go. I had a rummage in the header and found what I think is the swapimage code:

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

I have to admit it looks very confusing to me, I hope I've posted the right part! Thanks for your patience!