Take the 2-minute tour ×

I have a button on a page alongside some JS which gives it click-and-hold behaviour. Holding down the mouse button increases some value on the page over time. A demo of what I mean is here:


The problem is that when I view this page on my mobile (Android 2.3.5) the button behaviour is overridden my the browser. If I hold down the button, I get a prompt asking me if I want to save the button image.

Is there any way to prevent this behaviour in the browser, or otherwise implement this button behaviour on a page intended for mobile?

share|improve this question
Have a look at stackoverflow.com/a/5676504/348841 –  Jonas Stensved Apr 19 '12 at 8:15
add comment

3 Answers

up vote 2 down vote accepted

Have you tried some element with a background instead of image? Afaik, when u use div with a background browser should not popup a promt to save this image.

share|improve this answer
add comment

The button behaviors are managed by the phone/os manufacturers. For best webapp experience, you should try to avoid events like "hold down" and try to implement buttons for in-/decreasing the values. It's the same with sliders, there is no method for making a slider work on a touchscreen :)

regards chris

share|improve this answer
add comment

Try this:

$('.click_and_hold').mousedown(function(e) {

or you can try to return false on mousedown.

share|improve this answer
Sorry, that doesn't fix it. It still prompts me to download the button image. –  izb Apr 19 '12 at 8:24
add comment

Your Answer


