Fancy Tricks Page

I've been experimenting with JavaScript since I saw some great graphics tricks on Dac's Web site. I copied his JavaScript and did a few fun things with it. I put some of the tricks on the front page of the Web site, but that made it very slow. So I've taken them off there and moved them to this page. As I try more stuff, I'll add it here.

Thanks to Dac for the idea and code fragments.

Arrays of Images

For the first trick, move your cursor over the two photos. Several times each.

[Site Index] [This Site Defined]

This is done by building an array of images, and moving through the array whenever the mouse passes over the image. You have to create the images all exactly the same size. It just doesn't work if any of the images are slightly different in size.

By the way, if you're wondering what that strange three pronged phallic thing is in the set of photos on the right, they're heavily eroded rock formations called fairy towers, found in Cappodocia, Turkey. See my Turkey pages for a description.

Switching

This trick switches between two images when the mouse moves over the cursor. This was the original code fragment that I saw on Dac's site and pinched. I got this one working, and then expanded it to the previous array of images. Again, the two images have to be exactly identical in size.

[Switching]

Popup Windows

I wanted to do popup windows for the photo gallery of my photos from Turkey. What I wanted to do was let the user click on something, in this case a button, and have the image pop up and wait to be closed. To do that, I have to set up a form, set up a button within that form, and associate the button with a JavaScript function. That function creates a new window, writes some HTML into the document within the new window, and waits. If you exit the main HTML page, the popup window page will be automatically closed. I learnt how to do this through an example in a SAMS book Web Programming Unleashed by Bob Breedlove et al, and the fine details from the O'Reilly book JavaScript: The Definitive Guide by David Flanagan.

I abandoned this line of effort in May 2001, when I wrote a CGI program to do a much better job. See the Turkey photo gallery for how I did this.