I'll try to present the problem in the most simple form:
I have an array of elements on the page - "elmts". I have another element "controller" with a onmousedown handler that sets a mouseover event on "elmts". For simplicity, the mouseover function just displays a message:
function onmouseDownOnController(){
for var i = 0; i < elmts.length; i++){
elmts.onmouseover = mouseoverOnElmts;
}
}
function mouseoverOnElmts(){
alert("mouse over happened")
}
The array "elmts is either an array of <div> elments or <IMG> elements, all have id's so I can get the elements using document.getElementById.
Now, when "elmts" is an array of <div> elements, this work nicely. I click on "controller" then I move the mouse without releasing it to one of the "elmts" and the message "mouse over happened" pops up.
When "elmts" is an array of <IMG> objects I get a different behavior. When I click on "controller" and move the mouse to one of the images without releasing the mouse, nothing happens. Only after I release the mouse and then move to one of the images, the message pops up.
Why the onmouseover for the images is not activated while I still have the mouse down but it does so for divs?
Help would be appreciated.
Thanks
I have an array of elements on the page - "elmts". I have another element "controller" with a onmousedown handler that sets a mouseover event on "elmts". For simplicity, the mouseover function just displays a message:
function onmouseDownOnController(){
for var i = 0; i < elmts.length; i++){
elmts.onmouseover = mouseoverOnElmts;
}
}
function mouseoverOnElmts(){
alert("mouse over happened")
}
The array "elmts is either an array of <div> elments or <IMG> elements, all have id's so I can get the elements using document.getElementById.
Now, when "elmts" is an array of <div> elements, this work nicely. I click on "controller" then I move the mouse without releasing it to one of the "elmts" and the message "mouse over happened" pops up.
When "elmts" is an array of <IMG> objects I get a different behavior. When I click on "controller" and move the mouse to one of the images without releasing the mouse, nothing happens. Only after I release the mouse and then move to one of the images, the message pops up.
Why the onmouseover for the images is not activated while I still have the mouse down but it does so for divs?
Help would be appreciated.
Thanks