Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created July 24, 2011 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/1102724 to your computer and use it in GitHub Desktop.
Save walterdavis/1102724 to your computer and use it in GitHub Desktop.
$('myButton').observe('click',function(evt){
var opts = $w('page_one.html page_two.html page_three.html page_four.html');
return window.location.href = opts[Math.floor(Math.random() * opts.length)];
}).setStyle('cursor:pointer');
@walterdavis
Copy link
Author

This should be applied (by means of editing the ID of the button image) to a single layered image, no link or other tags needed. The script will add the button behavior automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment