The image button floats on top of the simple image <img src="2.jpg">, that you always wanted to use as a swap image, because of the z-index. Once it becomes invisible, plus goes beneath the 2.jpg (i.e. z-index: -1), the only thing the user can see is 2.jpg, which is not clickable.