selector.settings.callback

getSelector(id).settings.callback( element )

or getSelector(id).settings.callback( function )

Will execute the command on the element upon next selection, or the function whenever selection happens.

Example:

[js highlight=”9″ try=”true”]newImage(“square”, “square.png”)
,
newImage(“triangle”, “triangle.png”)
.settings.before( getImage(“square”) )
.print()
,
newSelector(“shapes”)
.settings.add( getImage(“square”) , getImage(“triangle”) )
.settings.callback( getSelector(“shapes”).shuffle() )
.wait()
[/js]

Adds two images side by side. The positions of the images are shuffled anytime either image is clicked.