javascript rollover effects question -


i learning js js book. rollover effects example got me, need help.

i upload snapshot on flickr.com. url : http://www.flickr.com/photos/58745632@n05/5389380030/

the left side of snapshot page , right side of snapshot javascript code. question can change content in red box codes in green box. if can, why author bother add line "thislink.imgtochange = thisimage"? , relationship between "thislink.imgtochange" , "thisimage"? same 1 or identical ones? explain me? thank much.

thisimage reference image object. being passed variable function.

an image object has properties source (.src), .width. height etc.

thislink object, , can have properites too. so, thislink.imgtochange = thisimage sets "imgtochange" image fed function. imgtochange arbitrary property chosen programmer. it's being used stash data used later.

all code demonstrates "hard way" of doing rollover. having type (or use) "document.getelementbyid" on , on again of pain. of time depend on scripts automate these things.

frameworks, optimized versions of type of code you're working on here, developed take care of dirty work. popular framework, far, jquery.

doing pretty same thing using jquery can done in 1 line of code.

here's another posting example.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -