×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Please i need to know very fast if

Please i need to know very fast if

Please i need to know very fast if

(OP)
Please i need to know very fast if u can help, can u see any problems with this bit of JavaScript code:<Script>

<!--
//Two variables created below using two images

picture1up=new Image; picture1up.src="weddings.jpg";
picture1down=new Image; picture1down.src="baby.jpg";

//Two functions follow
//Function 1 is called MouseOverRoutine

function MouseOverRoutine(image1)
{
if(image1=="picture1")
{document.picture1.src=picture1down.src;}
}

//Function 2 is called MouseOutRoutine

function MouseOutRoutine(image1)
{
if(image1=="picture1")
{document.picture1.src=picture1up.src;}
}
//-->
</script>

When i move over the image it says 'document.picture1' is not an object

Please can u help?

Regards

RE: Please i need to know very fast if

I'm into Java and not necessarily into JavaScript, but it seems to me that you haven't used a complete constructor. If you use a constructor that doesn't need any extra arguments, you still have to add empty brackets:
picture1up=new Image();
picture1up.src="weddings.jpg";
picture1down=new Image();
picture1down.src="baby.jpg";
...

Hope this solves your problem

P.S.: if it does,please vote for this post as being 'helpful'

Thanks, Cybex

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources