• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Drag and drop in Opera/Safari

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Drag and drop in Opera/Safari

    Quite why I have no idea but these browsers have an odd habit of implementing dragging by default. On a page with no jscript in it you can click on an image and a version of the image with a "no go sign" on it can be dragged around. On large background images a bit of it gets dragged.

    In an interactive it is confusing that inactive pictures are draggable. The bigger problem is that it interferes with wanted drag n drop in jscript. My code works ok if I click and leave the mouse in position for a second before I start moving. Too quick and I am moving this pointless ghost image around while the image I want to drag moves a little bit and the clicks gets all out of sync.

    Firefox has this ghosty thing too but it seems much faster and causes no drag n drop problems. Sensible IE (hooooray!) does not do it all.

    Any way of turning this behaviour off? Cheers.


    PS I have found somw D&D code that works (beats me what there is in it that is significantly diff from what I am using) but would still like to turn this behaviour off altogether if possible,
    Last edited by xoggoth; 16 September 2009, 17:17.
    bloggoth

    If everything isn't black and white, I say, 'Why the hell not?'
    John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

    #2
    Dragging your avatar around is just too scary!

    Comment


      #3
      Might this help.

      Comment


        #4
        Cheers OH! Bunged that handler that on a couple of images and it seems to work, no ghosty drag things in FF, opera or Safari.

        Ps Oh no! Google has come out with another browser!
        bloggoth

        If everything isn't black and white, I say, 'Why the hell not?'
        John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

        Comment


          #5
          Pleasure.

          Comment


            #6
            Hey, it all works in Google Chrome!

            Chrome opens pages in a flash too, unlike the others.
            bloggoth

            If everything isn't black and white, I say, 'Why the hell not?'
            John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

            Comment


              #7
              Xog.

              You do a lot of cross browser JavaScript. Are you using a framework such as JQuery or Prototype? Makes life a LOT easier.

              http://jquery.com/
              http://www.prototypejs.org/

              Can't believe people are hand coding drag n drop these days.

              I do a lot of cross browser JS/DOM/AJAX work and use jQuery extensively. Makes it a piece of cake.

              DP

              Comment


                #8
                New browsers support quite complex drag and drop stuff (which is defined in the HTML 5 spec) which you can extend and override in various wonderful ways.

                Try setting the draggable attribute on the relevant images to false:

                Code:
                <img src="slug_army.jpg" draggable="false" />
                and it should disable it.

                It's handy if you want to grab an image from a website: rather than mucking about with menus and so on, you can just grab the image and drag it onto the desktop.

                Comment


                  #9
                  Ta for new comments. Will check those.

                  Slug army eh? One never lives some things down on CUK.
                  bloggoth

                  If everything isn't black and white, I say, 'Why the hell not?'
                  John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                  Comment

                  Working...
                  X