Do u have any idea how can i detect if the mouse on acertain object
for exapmle I have <divi wnat if the mouse on this <divtake an
action ????
There are many events that you can monitor to do that (check the link
offered by Lost). Many approaches are possible: you can watch the
mousemove event, which is fired each time the mouse moves over on
element (but not when the mouse does not move anymore), or watch the
mouseover and mouseout events, to define some mouse state for your
element (beware of event bubbling). See below.
---
<head>
<style type="text/css">
div {background-color:yellow; margin:10px}
</style>
</head>
<body ondblclick="ale rt('Is the mouse over foo: ' + m())">
<div id="info">Doubl e click anywhere.</div>
<div id="foo">I am foo!</div>
<div id="not-foo">I am not foo!</div>
<script type="text/javascript">
// --- get some monitor function ---//
var m=monitorMouseM oveForElement(
document.getEle mentById("foo")
);
// --- lib ---//
function monitorMouseMov eForElement(ele m) {
var isMouseOver = false;
Comment