Shuffles the options that have been added to the DropDown so far. If you call
settings.add then it will have no effect.
getDropDown(ELEMENT_NAME).shuffle( "keep selected" )
- Passing an argument means that you want any option currently selected to remain selected after the shuffle (
"keep selected"is simply given as an example—you can pass an arbitrary string).
@newDropDown("warmth", "") @ .add("hot", "lukewarm", "cold") $ .shuffle() @, @newText("Spring in Colorado is ") @ .after( getDropDown("warmth") ) @ .print() @, @getDropDown("warmth") @ .wait()
- Creates a drop-down list containing the options hot, lukewarm and cold, shuffles them, adds the drop-down list to the right of the text Spring in Colorado is and prints everything onto the page, then waits until an option is selected from the drop-down list before proceeding.