I made a demo of a photo concept that toggles between two images to show a difference between between them.
I've got an onMouseClick event that works fine, except on the iPad. The response is instant on my desktop, but is quite delayed on the tablet, maybe 500ms?
Is this normal? Is there another way I can handle this?
Javascript:
var img1 = new Image();
img1.src = "http://watkinsfilm.com/wp-content/uploads/2012/09/19mm.jpg";
var img2 = new Image();
img2.src = "http://watkinsfilm.com/wp-content/uploads/2012/09/200mm.jpg";
function test() {
if (document.pic.src == 'http://watkinsfilm.com/wp-content/uploads/2012/09/19mm.jpg') {
document.pic.src = 'http://watkinsfilm.com/wp-content/uploads/2012/09/200mm.jpg';
}
else if (document.pic.src == 'http://watkinsfilm.com/wp-content/uploads/2012/09/200mm.jpg') {
document.pic.src = 'http://watkinsfilm.com/wp-content/uploads/2012/09/19mm.jpg';
}
}
Body:
<div>
<table id="table-1" >
<tr><td>
<img id="img" src="http://watkinsfilm.com/wp-content/uploads/2012/09/19mm.jpg" name="pic" onMouseDown="test()"/>
<img id="png1" src="http://www.thedigitaltrekker.com/wp-content/uploads/2012/03/logo-6smA.png"/>
Click on the image above to toggle between 19mm and 200mm <br>
</td></tr>
</table>
</div>
Also on jsfiddle: http://jsfiddle.net/ntmw/R4pey/5/