Your current javascript listens for mousedown, mouseup events and these events aren't triggered by default on touchscreen devices.
I'd recommend look at adding script to map touch events to the mouse events, so that your script could run on touchscreen or mouse driven devices, such as what is shown here.
jQuery Mobile also adds functionality to treat touch events as mouse events also, see vmousedown documentation for example.
Hope this helps :)