Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Help with image rollover please.
Old 01-14-2007, 04:31 AM Help with image rollover please.
Junior Talker

Posts: 2
Trades: 0
Hi,

I'm currently using the script found on http://www.kirupa.com/motiongraphics/rollover.htm

It works great but if you click a link the the back button it shows an error:
'myPics' is undefined

from:
var myImages = new Array ("Home.jpg", "HomeRoll.jpg"); var myPreload = new Array (); for (var i = 0; i < myImages.length; i++ ) { myPreload[ i ]= new Image(); myPreload[ i ].src = myPics[ i ]; }
Can anybody help me with this please or tell me why the error is occuring. What is the variable myPics even for?
I would appreciate any help.

Thanks
Brian
albino321 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2007, 05:33 AM Re: Help with image rollover please.
Oneway's Avatar
Skilled Talker

Posts: 71
Trades: 0
Seems like something got mixed up. myImages should be the same as myPics. But of course i don't which one was the original name.
Either change all occurances from myImages to myPics or change all occurances from myPics to myImages.
Code:
var myImages = new Array ("Home.jpg", "HomeRoll.jpg"); 
var myPreload = new Array (); 
for (var i = 0; i < myImages.length; i++ ) { 
  myPreload[ i ]= new Image(); 
  myPreload[ i ].src = myImages[ i ]; 
}
Oneway is offline
Reply With Quote
View Public Profile
 
Old 01-14-2007, 01:00 PM Re: Help with image rollover please.
Junior Talker

Posts: 2
Trades: 0
Awesome, thanks a lot. Error's gone.
albino321 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with image rollover please.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21782 seconds with 12 queries