problems with a draggable box

Discussion in 'JavaScript' started by renlok, Sep 9, 2008.

  1. #1
    on my page i have a draggable box (you can move it around the page) the problem im having is when you drag the box over text/an image it highlights it is there anyway to stop it from doing this?

    Also this onyl happens in firefox in IE it seems to work fine.
     
    renlok, Sep 9, 2008 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    When you trap your onmousedown, if it is intercepted by your script saying yes, you selected an item, make certain you 'return false;' - otherwise that mousedown will still be passed to other stuff.

    If you are returning false, it shouldn't select.

    I'd have to see your code to be sure though - making sure that return works would mean knowing how you are trapping onmouseup and onmousedown.

    Have a look at this I did for someone else a while back:
    http://battletech.hopto.org/for_others/ag/template.html

    the directory is unlocked:
    http://battletech.hopto.org/for_others/ag

    You can see you can drag those around without selecting just fine.
     
    deathshadow, Sep 11, 2008 IP
  3. AimHigher

    AimHigher Member

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Nicely done :)
     
    AimHigher, Sep 11, 2008 IP