Wednesday, 21 August 2013

Mobile Phone Touch Event

Mobile Phone Touch Event

I want to create a slider. Here is my javascript code:
<div
style='width:50px;height:50px;position:absolute;top:0;left:0;background:#000'>
</div>
<script type="text/javascript">
$(document).bind('mousemove',function(ev){
$('#ghgh').offset({left:(ev.pageX-25)});});
</script>
This, however, only works in computers but not touch screen. I have tried
to use events like touchmove,slide,scroll,etc. yet none of them works.
What events should I use in order to make it works in touch screens?

No comments:

Post a Comment