Check out Alice Chess, our featured variant for June, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

[Subject Thread] [Add Response]
H. G. Muller wrote on Thu, Oct 16, 2008 05:06 PM EDT:
The goths.html page on my website is powered by JavaScript. I am not really
a JavaScript expert (someone helped me write the program, but I understand
how it works), but it seems to me that what you want is not too difficult.
My viewer does not allow you to move pieces around, but there is a similar
feature: you can click alternate representations of the Archbishop and
Chancellor, and then it alters the board display accordingly.

The trick is that you can put an 'a' tag around some html element (e.g.
the 'img' tag defining the picture displayed in a square), with an
onClick='' parameter in it. Through this you can let a JavaScript
subroutine be called, which can assign to global variables (to remember
which from-square was clicked), or replace html elements by other elements
(on the second click). If you wantto have a look at the (rather simple)
javaScript code of the viewer, you can find it at

http://home.hccnet.nl/h..muller/chess.js