更改鼠标指针 [英] change mouse pointer

查看:126
本文介绍了更改鼠标指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用java sript单击按钮后更改鼠标光标.
我使用了document.all.ShowPages.style.cursor = "hand";,这是行不通的.

请尽快给我答复

谢谢

I want to change mouse cursor after click on button using java sript.
i used document.all.ShowPages.style.cursor = "hand"; this one is not working.

please send me answer soon

thanks

推荐答案

我尝试过,它不起作用; "document.all"也不起作用.
为什么不选择"document.body.style.cursor =" wait";"? —有效.

-SA
I tried, it does not work; "document.all" also does not work.
Why not "document.body.style.cursor = ''wait'';"? — it works.

—SA


此处 [ ^ ]中,您将获得所有适用于游标样式的有效值.

对于跨浏览器,
Here[^] you go for all valid values for Cursor style.

For cross browser,
style="cursor: pointer; cursor: hand;"


你好,

使用以下代码:
Hello,

Use the following code:
document.body.style.cursor = "progress";




或者,您可以使用以下代码:(这使用CSS类设置光标)

风格:




OR you can use the following code: (This uses CSS class to set cursor)

Style:

<style type="text/css">
        .cursorPointer
        {
            cursor: pointer;
        }
        .cursorPointer2
        {
            cursor: progress;
        }
    </style>



剧本:



Script:

function Change() {
            document.getElementById("pagebody").className = "cursorPointer2";
            //document.getElementById("pagebody").style.cursor = "progress";
        }



HTML:



HTML:

<body class="cursorPointer" id="pagebody">
<input type="button" value="ChangeCursor" onclick="resettextbox(''Value'');" />
</body>


这篇关于更改鼠标指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆