RobG wrote:
Jim Ley wrote:
On Sun, 23 Jul 2006 13:24:06 +1000, RobG <rg***@iinet.net.auwrote:
mc*******@wright.edu wrote:
[...]
>Is it possible to make a cursor into an hourglass over a drop down?
If by 'drop down' you mean an HTML select element, yes. You can use a
'wait' cursor over all select elements using CSS:
<style type="text/css">
select {cursor: wait;}
</style>
You can use selectors to change the cursor based on the element's id or
class attributes. You can also use in-line styles:
<select style="cursor: wait;" ... >
[...]
The script above is equivalent to using the above.
OP - the better approach to this is not to change every cursor -
that's really, really slow - just add a mousemove handler to the page
and change the cursor of the element under the cursor, much more
efficient.
Do you mean something like:
<script type="text/javascript">
function doWait(e){
var tgt = e.target || e.srcElement;
if (tgt && tgt.tagName && tgt.style){
if ('select' == tgt.tagName.toLowerCase()){
tgt.style.cursor = 'wait';
} else {
tgt.style.cursor = 'normal';
}
}
}
</script>
<body onmouseover="doWait(event);"... </body>
I think CSS provides a much more elegant solution.
--
Rob
I found this script which uses the BODY method:
<html>
<head>
<script type="text/javascript">
function Change_Cursor(Param1)
{
document.body.style.cursor = Param1
}
</script>
<body>
<a href="#" onclick="Change_Cursor('wait')">Change Cursor to
Wait</a><br>
<a href="#" onclick="Change_Cursor('pointer')">Change Cursor to
Pointer</a><br>
<a href="#" onclick="Change_Cursor('default')">Change Cursor to
Default</a><br>
<form>
<select>
<option>ABCDFEGHIJKLMNO</opion>
<option>PQRSTUVWXYZ1234</opion>
<option>567890ABCDFEGHI</opion>
</select>
</form>
</body>
</html>
Problem is, when you moueover elements like the LINKS or the SELECT
box, it reverts to the default behavior for those items.
Maybe you should step through every node stemming from the BODY and
change it over? And then to reset re-step and change settings back to
default?
Someone must have code this already, right?
Giggle Girl