JavaScript click and hover function needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bryan41
    New Member
    • May 2012
    • 4

    JavaScript click and hover function needed

    Okay, So I don't want a website like this http://colorpx.com/, but the idea of how the Click and Hover function works. I can't seem to find that script they have or what it's called to look it up. But I'm sure it's very simple.

    I want to be able to click and (not release) and drag over other Div's and change the element of multiply ones without having to release the mouse button.

    Sorry for nooby question if this is something very simple. And can someone show me how to port it into my website to work.

    Thanks!
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you mean "Drag & Drop" ?

    Comment

    • bryan41
      New Member
      • May 2012
      • 4

      #3
      Not sure if that's what it is. Whatever is how the website http://colorpx.com/ does theirs.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        that’s plain event handling. each of the squares has a couple of (Mouse) event listeners that colour the squares. (e.g. if you click on a square, it paints it in the defined colour)

        Comment

        • bryan41
          New Member
          • May 2012
          • 4

          #5
          Dormilich,

          I know this, but I'm talking about just clicking once and then hovering over the squares to activate them. Instead of clicking on each individual one.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Use the onmouseover and onmouseout events.

            Comment

            • bryan41
              New Member
              • May 2012
              • 4

              #7
              Yes, but how would I be able to implament that into my code...

              I want to be able to change inputs with class "iput"..
              How would the javascript look?

              Please help, this is killing me.

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                when you look at the site, you see how much JS code is used to create that effect. a full code analysis will be not that easy.

                Comment

                • Rabbit
                  Recognized Expert MVP
                  • Jan 2007
                  • 12517

                  #9
                  Yes, but how would I be able to implament that into my code...
                  That depends on what you're trying to do. And you have not give an accurate and detailed description of what you're trying to do. But in general, you implement events like so:
                  Code:
                  <div onmouseover="somefunction()"></div>
                  I want to be able to change inputs with class "iput"..
                  How would the javascript look?
                  I have no idea what this means.

                  Please help, this is killing me.
                  I doubt that.

                  Comment

                  Working...