1. Download our Official Android App: Forums for Android!

Support Drag item in browser?

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

  1. RolandTumble

    RolandTumble Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    11
    Joined:
    Mar 14, 2011

    Mar 14, 2011
    11
    0
    15
    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.
     

    Advertisement

  2. adam97202

    adam97202 Well-Known Member
    Rank:
    None
    Points:
    43
    Posts:
    179
    Joined:
    Feb 3, 2011

    Feb 3, 2011
    179
    39
    43
    Portland, OR
    That's a good question, I'd love to know if someone has an answer.
     
  3. syav

    syav Well-Known Member
    Rank:
    None
    Points:
    73
    Posts:
    234
    Joined:
    Apr 6, 2011

    Apr 6, 2011
    234
    59
    73
    Can u post a link here to the website that has "drag item to reorder"?
     
  4. RolandTumble

    RolandTumble Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    11
    Joined:
    Mar 14, 2011

    Mar 14, 2011
    11
    0
    15
    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
    Rank:
    None
    Points:
    36
    Posts:
    24
    Joined:
    Jun 17, 2011

    Jun 17, 2011
    24
    4
    36
    Mechanical Engineer
    New Orleans, LA
    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
    Rank:
    None
    Points:
    163
    Posts:
    1,722
    Joined:
    Jan 31, 2011

    Jan 31, 2011
    1,722
    262
    163
    Texas
    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
    Rank:
    None
    Points:
    16
    Posts:
    23
    Joined:
    Jul 14, 2011

    Jul 14, 2011
    23
    2
    16
    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 ) {
    2.  
    3.                 event.preventDefault();
    4.  
    5.                 document.addEventListener( 'mousemove', onDocumentMouseMove, false );
    6.                 document.addEventListener( 'mouseup', onDocumentMouseUp, false );
    7.                 document.addEventListener( 'mouseout', onDocumentMouseOut, false );
    8.  
    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.
Tags:

Share This Page

Loading...