0

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.

1 Answer 1

1

Pseudo code :

parentElement.onmousedown = function() {
   this.onmouseover = handleMouseOver;
}

document.onmouseup = function() {
   parentElement.onmouseover = null;
}

function handleMouseOver(oEvent) {
   var el = oEvent.srcElement || oEvent.target;
   // do something with he mouse overed element.
}
Sign up to request clarification or add additional context in comments.

3 Comments

jQuery is a JavaScript library, so this isn't an either/or question. It's a case of choose your poison. I'd suggest using jQuery as it solves cross browser issues you may not be familiar with if you are new to JavaScript.
Peter, I don't know Javascript or Jquery that well, so yeah, I'm new to it. But could you help me? I want to know how to implement this code into my website so I can get it to work ASAP.
You're unlikely to get help from me or anyone else with a do it for me style approach. Have a go at implementing it yourself, then come back and a specific question about a bit that's not working as you expect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.