【问题标题】:javascript mouse cursor change on page load in firefox browser 3.5在Firefox浏览器3.5中页面加载时javascript鼠标光标更改
【发布时间】:2010-03-16 11:11:27
【问题描述】:

嗨,如果是整页,请提交一个透明的 div id 并将光标更改为 'wait' 。现在,当页面被提交并且新页面出现时,光标仍然保持“等待”而不是更改为默认值,直到鼠标在 Firefox 中移动

这是一个简单的 html 点击显示按钮 div 当用户将鼠标移动到 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>

【问题讨论】:

标签: javascript jquery mouse cursor


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    那是一些乱七八糟的代码......

    为什么不使用图像或 css 在透明背景上显示 div 并在 css 或样式标签上显示 cursor: wait;,然后随时显示该 div...

    HTML &lt;div id="modal"&gt;&amp;nbsp;&lt;/div&gt; &lt;input id="test" type="text" /&gt;

    jQuery

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

    我还没有对此进行测试...理论上它应该可以工作...如果没有尝试将身体宽度和高度更改为“100%”

    保重

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-15
      • 1970-01-01
      • 1970-01-01
      • 2011-05-02
      • 1970-01-01
      • 1970-01-01
      • 2013-06-29
      • 1970-01-01
      相关资源
      最近更新 更多