In article <jdz_a.11483$M6.980997@newsread1.prod.itd.earthlin k.net>,
condorschool@earthlink.net enlightened us with...
[color=blue]
> fnChangeBg = function (nIndex) {
> var _bg = new Image()
> defaultStatus = "Loading background image ["+arBgs[nIndex]+"]. Please
> wait..."
> _bg.onload = function () {
> _cover.style.backgroundImage = "url("+this.src+")"; // THIS IS WHERE I
> NEED HELP! WHAT DOES THIS LINE DO?![/color]
It changes the source of the background image of the object _cover to
the image (source) pointed to by the variable _bg. That would be the
line
_bg.src = "images/working_items/"+arBgs[nIndex]+".jpg"
So the object pointed to by _cover would have a background of one of the
images in that string array at the beginning of the code.
The "this" keyword refers to the object (_bg). We know this because the
function is called on the object referred to by _bg. It runs when _bg
loads.
HTH
-------------------------------------------------
~kaeli~
Why do people who know the least know it the loudest?
If that cell phone was up your a$$, maybe you could
drive a little better!
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------