1. Are you ready for the Galaxy S20? Here is everything we know so far!

Drag item in browser?

Discussion in 'Android Devices' started by RolandTumble, May 26, 2011.

  1. RolandTumble

    RolandTumble Newbie
    Thread Starter

    Is there any way to drag an on-screen item in the web browser?

    I was at a site that wanted me to "drag items to reorder", & I couldn't do it. Dragging only scrolled the screen. I found a suggestion about a similar issue to use a "pinch", but all that does is zoom.

    I get the same behavior in Skyfire & in the default browser.

    1. Download the Forums for Android™ app!


  2. adam97202

    adam97202 Well-Known Member

    That's a good question, I'd love to know if someone has an answer.
  3. syav

    syav Well-Known Member

    Can u post a link here to the website that has "drag item to reorder"?
  4. RolandTumble

    RolandTumble Newbie
    Thread Starter

    Sorry, can't post a link. The only one I know of was the one I encountered, and it was a single page of a multi-page survey.

    In case it wasn't clear, "reorder" is in the sense of ranking, not of buying again.

    I did contact "support" at that site, pointing out the problem with that interface paradigm....

    Thanks for the interest, at least.
  5. jean15paul

    jean15paul Newbie

    I don't have an Optimus V, but this came up when I was about to post a similar question in another forum. Does anyone have an answer? Even if it cant' be done with the native browser, are there any other browsers that support a drag function?
  6. tcat007

    tcat007 Android Expert

    Doesn't work in Boat Browser either. Probably not possible. Here's a page that you can reorder items as a test (on a PC at least):

    [FONT=tahoma,sans-serif]ReorderList Sample[/FONT]
  7. trusktr

    trusktr Newbie

    To answer the question, such a feature must be implmented by the developer who makes the website. Javascript has to be used to prevent the default action when the mouse button is clicked down (this is equivalent to putting your finger on the screen on mobile devices). When the mouseDown event is fired by putting your finger on the screen, then there must also be code that will detect mouse position on the screen (your finger) to be able to update the position of the draggable item.

    To see an example of a website where the default action for mouseDown has been prevented and thus lets your finger interact with the website, see this:
    three.js canvas - geometry - cube

    Notice that you can drag the cube without dragging the screen with your finger.

    The code used for that looks like this:

    Code (Text):
    1.             function onDocumentMouseDown( event ) {
    3.                 event.preventDefault();
    5.                 document.addEventListener( 'mousemove', onDocumentMouseMove, false );
    6.                 document.addEventListener( 'mouseup', onDocumentMouseUp, false );
    7.                 document.addEventListener( 'mouseout', onDocumentMouseOut, false );
    9.                 mouseXOnMouseDown = event.clientX - windowHalfX;
    10.                 targetRotationOnMouseDown = targetRotation;
    11.             }
    So to answer RolandTumble's question, it works when the developer takes into account that he will have users on mobile devices viewing his site and takes appropriate action in his code.
    AndyOpie150 likes this.

LG Optimus V Forum

Features and specs are not yet known.

Release Date

Share This Page