Help Cursor is not working in the firefox browser

余生长醉 提交于 2019-12-12 04:35:23

问题


<html>

<head>
<title>Question</title>
<script type="text/javascript" >
function MouseOverHand(ID)
{
var Cursor='hand';
var ID=ID;
if (!document.all){ Cursor='pointer'; }
document.getElementById(ID).style.cursor=Cursor;        
}
</script>
<script type="text/javascript" >
function MouseOverHelp(ID)
{
var Cursor='help';
var ID=ID;
if (!document.all){ Cursor='pointer'; }
document.getElementById(ID).style.cursor=Cursor;        
}
</script>
</head>

<body>
<label id="Hand" onmouseover="MouseOverHand('Hand');" > Hand </label><br/><br/>
<label id="Help" onmouseover="MouseOverHelp('Help');" > Help </label>
</body>

</html>

In the above html is used to take mouse cursor in the mouse over of label's. Here "Hand" and "help" cursor is working fine in internet explore but its not working in firefox and other browser's

hoping your support,


回答1:


you don't need var Cursor if you can specify help or hand directly like so

document.getElementById(ID).style.cursor='hand';        

and

document.getElementById(ID).style.cursor='help';        

please check working example and take a look at the html source code




回答2:


Simpler version, works on 'all' browsers:

<script type="text/javascript" >
function MouseOverPointer(obj) //obj is the triggering element
{
    if(obj.id=='Help')
        obj.style.cursor = "help";
    else if(obj.id=='Hand')
        obj.style.cursor = "pointer";
}
</script>

<label id="Hand" onmouseover="MouseOverPointer(this);" > Hand </label><br/><br/>
<label id="Help" onmouseover="MouseOverPointer(this);" > Help </label>



回答3:


"Hand" does not work in Firefox. Try "pointer". "help", however, should work -- try applying the style in a more direct way than via JS.



来源:https://stackoverflow.com/questions/1695709/help-cursor-is-not-working-in-the-firefox-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!