Tag: dynamic css

将光标等待整个html页面

是否有可能以简单的方式将光标设置为“等待”整个HTML页面? 这个想法是告诉用户,一个Ajax调用正在完成时发生了什么事情。 下面的代码显示了我尝试的简化版本,并演示了遇到的问题: 如果一个元素(#id1)有一个光标样式设置,它将忽略设置在身上(明显) 某些元素具有默认的光标样式(a),不会在hover时显示等待光标 body元素具有一定的高度取决于内容,如果页面很短,光标不会显示在页脚下面 考试: <html> <head> <style type="text/css"> #id1 { background-color: #06f; cursor: pointer; } #id2 { background-color: #f60; } </style> </head> <body> <div id="id1">cursor: pointer</div> <div id="id2">no cursor</div> <a href="#" onclick="document.body.style.cursor = 'wait'; return false">Do something</a> </body> </html> 稍后编辑… 它在Firefox和IE中工作: div#mask { display: none; cursor: wait; z-index: 9999; position: absolute; top: […]

根据一天中的时间更改背景(使用JavaScript)

好吧,我有两个不同的背景.jpg,我想用它作为背景,取决于一天中的什么时间。 我想要从早上7点到晚上8点的阳光明媚的背景和晚上8点到7点的夜晚背景。 我正在处理一个远程html文件,我有背景和graphics存储在一个单独的服务器从实际的html文件。 大部分的CSS都在html文件中,除了包含背景代码的正文部分,我将它们分离并移动到外部样式表中。 我做了两个独立的样式表,一个是每天的图像和一个晚上的图像。 这是在夜间CSS样式表的身体CSS。 @charset "UTF-8"; /* CSS Document */ body { background-image: url('http://itsnotch.com/tumblrhttp://img.dovov.comdaytime_bg.jpg') !important; background-repeat: repeat-x !important; background-attachment: fixed !important; background-position: top center !important; background-color:#b68e59 !important; margin-top:-5px !important; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size:14px !important; } 我写了一个JavaScript代码,我认为会工作。 但事实并非如此。 我把它放在下面,它仍然没有工作。 为什么它不工作? 我只是想能够切换出时间敏感的背景。 <script type="text/JavaScript"> <!– function getStylesheet() { var currentTime = […]