Here is the code for the game. The main idea: put all possible states of the image into one large image, set the "window size", which is smaller than the image; move the window around using background-position
.
#test { display: block; width: 250px; height: 337px; background: url(http://vi.sualize.us/thumbs/08/09/01/fashion,indie,inspiration,portrait-f825c152cc04c3dbbb6a38174a32a00f_h.jpg) no-repeat; border: 1px solid red; text-indent: -1000px; } #test:hover { background-position: -250px 0; }
<a href="#" id="test">a button</a>
user6205
source share