Go Back   Android Forums > Android Discussion > Android Applications
Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.

test: Reply
 
LinkBack Thread Tools
Old September 15th, 2010, 10:02 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2010
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Money [Solved] How to disable tap&drag as scrolling in browser?

Hello all. I'm sorry to double post, but this is very important to me. I am making an intranet website that exactly fits the screen of the device it will be used on (Archos 7 home tablet in this case, Android 1.5).

All browsers (default, dolphin, steel, UC) interpret tap&drag on a website as scrolling. I don't want this. Ideally, I want it to be registered as mouse actions. Is there a way to do this? Thanks in advance!

- Chris

Advertisements
cdehaan is offline  
Last edited by cdehaan; September 15th, 2010 at 04:06 PM. Reason: I solved it, updated the title to show that.
Reply With Quote
sponsored links
Old September 15th, 2010, 04:04 PM   #2 (permalink)
New Member
Thread Author (OP)
 
Join Date: Sep 2010
Posts: 7
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Money Answer to my own question

Well, in case anyone else wants to know how to do this, here's the answer:

First, register onTOUCH (not onMOUSE) events in the body tag, or wherever you want this behavior. For example:


<body ontouchstart="touchStartFunction(event);" ontouchmove="touchMoveFunction(event);" ontouchend="touchEndFunction(event);">


Second, in your ontouchstart event, add the following line:

event.preventDefault();


Now you can use the touch events. To get the X position of the touch, for example, use this:

var touch = event.touches[0];
document.getElementById('touchMoveTextbox').value = "Touch move at " + touch.pageX;


Hope this helps someone.
cdehaan is offline  
Reply With Quote
Reply
Tags
browser, dolphin, mouse, scrolling, steel, website


Go Back   Android Forums > Android Discussion > Android Applications
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:21 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.