Hey guys, i really have to do this simple website in a few hours and i can't figure out the coding.
I'm noob and the coding shouldnt be hard at all so pleeease try to help me. I'll give you uh, 100 pts?
Imagine a list of names down the left side and a picture on the right side. When user mouseover's the names, i want the picture on the right to show the person whose name is being moused over.
I found this code on the internet but i dont understand all the parts of it and how to make it work.
If you can't explain in here i'll really appreciate it if you could PM me or chat with me on msn to sort it out.
-------------------
// copyright 1998 Idocs, Inc. http://www.idocs.com/tags/
// Distribute this script freely, but please keep this
// notice with the code.
// var image information object what's this?
var mloi=new Object();
// set the image for swapping
function setswap()
{
if (! document.images)return; is "images" just the folder where my image is?
var imgInfo=new Object(); i dont understand this whole chunk, do i need to change anything?
imgInfo.defaultImg = new Image();
imgInfo.defaultImg.src = document.images[arguments[0].src;
imgInfo.opts = new Object();
for (var i=1; i < arguments.length; i=i+2)
{
imgInfo.opts[arguments]=new Image();
imgInfo.opts[arguments].src = arguments[i+1];
}
mloi[arguments[0] = imgInfo;
}
// set up the link for swapping what does 'return' mean?
function swap(link,imgName,optName)
{
if (! document.images)return;
if (! link.swapReady)
{
link.imgName = imgName;
link.onmouseout = swapBack;
link.swapReady = true;
}
document.images[imgName].src=mloi[imgName].opts[optName].src;
}
function swapBack()
{document.images[this.imgName].src=mloi[this.imgName].defaultImg.src}
//-->
</SCRIPT>
------------------------------------
Post edited at 2:41 pm on Jan. 9, 2007 by tell me again