javascript 鼠标光标在 Firefox 浏览器 3.5 中页面加载时发生变化

发布于 2024-08-25 06:40:58 字数 1374 浏览 2 评论 0原文

您好,如果是整页,请提交一个透明的 div id,并将光标更改为“等待”。现在,当页面正在提交并且新页面即将出现时,光标仍然保持“等待”状态,直到鼠标在 Firefox 中移动为止,不会更改为默认值

这是简单的 html,当用户将鼠标移动到 div 光标上时,单击显示按钮 div 就会出现更改为等待光标。现在,当再次加载此页面时,按 F5 光标在 Firefox 中保持为等待光标,它在 IE 中工作正常,有什么方法可以使光标在 Firefox 中的页面加载时默认显示

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style>
        body {
            cursor:default;
        }
    </style>
    <script src="js/jquery.js"> </script>
    <script>
        var test = true;
        $(document).ready(function() {
            $('#maindiv').css('display','none')
        });
        function showDiv() {
            $('#maindiv').css('display','block')
        }
    </script>
</head>
<body>
    <div id="divBody" style="background-color:red;width:500px;height:500px" >aa
        <div id="maindiv" style="background-color:#999999;height:100$;width:400px;height:400px;cursor:wait">
            sss
        </div>aa
   </div>
    <input  type="button" value="show" onclick="showDiv()"/>
</body>
</html>

Hi in case of full page submit a trasparent div id coming and changing the cursor to 'wait' . Now when the page is getting submitted and new page is coming up cursor still remains to 'wait' not changing to default until mouse is moved in Firefox

Here is simple html click on show button div is coming when user move mouse over the div cursor is changing as wait cursor. Now when this page is loaded again pressing F5 cursor remain as wait cursor in firefox its working fine in IE is there any way to make the cursor as default on pageload in Firefox

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style>
        body {
            cursor:default;
        }
    </style>
    <script src="js/jquery.js"> </script>
    <script>
        var test = true;
        $(document).ready(function() {
            $('#maindiv').css('display','none')
        });
        function showDiv() {
            $('#maindiv').css('display','block')
        }
    </script>
</head>
<body>
    <div id="divBody" style="background-color:red;width:500px;height:500px" >aa
        <div id="maindiv" style="background-color:#999999;height:100$;width:400px;height:400px;cursor:wait">
            sss
        </div>aa
   </div>
    <input  type="button" value="show" onclick="showDiv()"/>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何以心动 2024-09-01 06:40:58

您可以使用动画图像来给用户反馈而不是改变光标吗?

ajaxload.info 有一些很好的例子。

Could you use an animated image to give the user feedback instead of changing the cursor?

ajaxload.info has some great examples.

っ〆星空下的拥抱 2024-09-01 06:40:58

那是一些混乱的代码...

为什么不使用图像或 css 在其他所有内容之上显示一个带有透明背景的 div 和 cursor: wait; 在你的 css 或样式标记上,然后在什么时候显示该 div随你所愿...

HTML


JQuery

$('#modal').css({cursor: 'wait'}).width($(document).width()).height($(document).height());
$('#test').bind('click',function (){$('#modal').show()})

我还没有测试过这个所以......理论上它应该工作......如果不尝试改变主体宽度和高度“100%”

照顾

thats some messy code...

why not use an image or, css to display a div on top of everything else with transparent background and cursor: wait; on your css or style tag then show that div when ever you wish...

HTML
<div id="modal"> </div>
<input id="test" type="text" />

JQuery

$('#modal').css({cursor: 'wait'}).width($(document).width()).height($(document).height());
$('#test').bind('click',function (){$('#modal').show()})

I have not tested this so ... in theory it should work ... if not try and change body width and height to "100%"

take care

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文