LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 650 users online 165644 members 1444 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
5 online / 43 MPM
Fresh Topics
  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Viewing Topic

POINTS - heeeelp!
i'm so noob
Replies: 4Last Post Jan. 9, 2007 7:51pm by oubipaws
Single page for this topic Email Print Favorite
( tell me again )


Enlightened One

Patron
Reply
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


2:33 pm on Jan. 9, 2007 | Joined June 2006 | 478 Days Active
Join to learn more about tell me again Australia | Label Free Female | 6113 Posts | 15176 Points
Heart92


Unwritten Heart

Patron
Reply
What website is it for?

-------
♥ Members with Deviantart Accounts
We love Springs!

2:35 pm on Jan. 9, 2007 | Joined Nov. 2006 | 453 Days Active
Join to learn more about Heart92 California, United States | Straight Female | 18419 Posts | 24538 Points
( tell me again )


Enlightened One

Patron
Reply
And for this onMouseover bit:  


<A HREF="alex.html"    onMouseOver="swap(this,'showperson','alex')">Alex C</A><BR>

 


what do i replace the bold bit with? i mean, what is actually that part in the example? a webpage? image? what?

Post edited at 2:44 pm on Jan. 9, 2007 by tell me again


2:43 pm on Jan. 9, 2007 | Joined June 2006 | 478 Days Active
Join to learn more about tell me again Australia | Label Free Female | 6113 Posts | 15176 Points
( tell me again )


Enlightened One

Patron
Reply
heeeeeeeeeeeeeelp.  *bump*

3:17 pm on Jan. 9, 2007 | Joined June 2006 | 478 Days Active
Join to learn more about tell me again Australia | Label Free Female | 6113 Posts | 15176 Points
oubipaws


Technician
Reply
Have you looked into doing it Ajax?  Javascript has some excellent rollover effects where you could just use like the code above.

What is your web structure like?  
/wwwroot/images?  

-------
Social Twist News | Flash Games


7:51 pm on Jan. 9, 2007 | Joined Jan. 2007 | 6 Days Active
Join to learn more about oubipaws South Carolina, United States | Straight Male | 153 Posts | 321 Points
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Viewing Topic