PDA

View Full Version : [javascript] Preloading images? How?


Lea Verou
07-05-2007, 05:29 PM
I want to preload some images.
I used this javascript code:
window.onload = function preload_tabimages()
{
//preloading images
var gk_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/gk.gif";
var t_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/t.gif";
var ets_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/ets.gif";
var sx_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/sx.gif";
var s_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/s.gif";
}

but it doesn't seem to work... Any ideas? :(
Thanks in advance!

Carnage
07-07-2007, 08:01 PM
var gk_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/gk.gif";
var t_tab = new Image();
gk_tab.src = "$vboptions[bburl]/newera/karteles/t.gif";


i've highlighted something up there. Seems to me you've messed up the variable names.

Lea Verou
07-08-2007, 03:19 AM
Ooops!!! I'm such an idiot!
Thanks!