Web Analytics Made Easy -
StatCounter Over-riding I-beam cursor onmousedown-drag - CodingForum

Announcement

Collapse
No announcement yet.

Over-riding I-beam cursor onmousedown-drag

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

  • Over-riding I-beam cursor onmousedown-drag

    I have created a drag script and am having a problem with the cursor. When I hover over the div, the cursor becomes "move" as I want it to be. But if I click, then drag it changes to the I-beam cursor. I am wondering what I can do to get it to stay "move" or whatever I'd like it to be. I know things like onselectstart, etc, but that doesn't seem to do anything. Thanks for your time.
    Adobe Dreamweaver shall be destroyed!

  • #2
    CSS could be of help here instead (not sure, but it's worth a try).

    Just set the CSS to use cursor:move; or cursor:move !important; as one of its styles and see if that helps.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

    Comment


    • #3
      Hmm, this is interesting. I can seem to get it to work when I have the div on the page already, but if I use createElement and create a div it gets the I-beam cursor.

      But... if I have a div on a page, and then use createElement, the create element one will work.
      Adobe Dreamweaver shall be destroyed!

      Comment


      • #4
        If all else fails you could probably add that cursor CSS to the div with javascript something like this:

        Code:
        my_element.style.cursor="move";
        You could do that right after you create the element.

        That's the same basic idea as before, but it might overcome the issue with generated divs not working...
        The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
        See Mediocrity in its Infancy
        It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
        Seek and you shall find... basically:
        validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

        Comment


        • #5
          Yeah, I've tried that one, before, and now. The I-beam still pops up. Not sure if you use twitter, but if you do and you have done dragged the popup thing that you can get there, there's goes to an ibeam too. So I'm wondering if it's just because of createElement or not.
          Adobe Dreamweaver shall be destroyed!

          Comment


          • #6
            Could be. I can't say that I've ever tried to tackle this specific issue before.

            Which browser(s) does this happen in?
            The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
            See Mediocrity in its Infancy
            It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
            Seek and you shall find... basically:
            validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

            Comment


            • #7
              Last thing I can think of for now is to add an "onmouseover" attribute to the new div elements that changes the cursor. Maybe user interaction with the page will knock the sense back into the div?

              Ya know?
              The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
              See Mediocrity in its Infancy
              It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
              Seek and you shall find... basically:
              validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

              Comment


              • #8
                Nope, that didn't knock any sense into that stupid createdElement. lol
                Adobe Dreamweaver shall be destroyed!

                Comment


                • #9
                  Can you post a simple page showing this issue? And what browser are you using?
                  Glenn
                  vBulletin Mods That Rock!

                  Comment


                  • #10
                    Using chrome.

                    Simple example page: http://vorogh.com/Example/
                    Adobe Dreamweaver shall be destroyed!

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎