JavaScript Set Cursor Style
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<script language="JavaScript"> function setCursorByID(id, cursorStyle) {
var elem;
if (document.getElementById && (elem = document.getElementById(id))) {
if (elem.style)
elem.style.cursor = cursorStyle;
}
} </script>
</head>
<body>
<span style="cursor: auto;">auto</span>
<span style="cursor: move;">move</span>
<span style="cursor: no-drop;">no-drop</span>
<span style="cursor: col-resize;">col-resize</span>
<span style="cursor: all-scroll;">all-scroll</span>
<span style="cursor: pointer;">pointer</span>
<span style="cursor: not-allowed;">not-allowed</span>
<span style="cursor: row-resize;">row-resize</span>
<span style="cursor: crosshair;">crosshair</span>
<span style="cursor: progress;">progress</span>
<span style="cursor: e-resize;">e-resize</span>
<span style="cursor: ne-resize;">ne-resize</span>
<span style="cursor: default;">default</span>
<span style="cursor: text;">text</span>
<span style="cursor: n-resize;">n-resize</span>
<span style="cursor: nw-resize;">nw-resize</span>
<span style="cursor: help;">help</span>
<span style="cursor: vertical-text;">vertical-text</span>
<span style="cursor: s-resize;">s-resize</span>
<span style="cursor: se-resize;">se-resize</span>
<span style="cursor: inherit;">inherit</span>
<span style="cursor: wait;">wait</span>
<span style="cursor: w-resize;">w-resize</span>
<span style="cursor: sw-resize;">sw-resize</span>
<div>
<a id="e1h" href="#" style="cursor: help;" onclick="setCursorByID('e1','help');return false;">help</a>
<a id="e1w" href="#" style="cursor: wait;" onclick="setCursorByID('e1','wait');return false;">wait</a>
<a id="e1m" href="#" style="cursor: move;" onclick="setCursorByID('e1','move');return false;">move</a>
<a id="e1c" href="#" style="cursor: crosshair;" onclick="setCursorByID('e1','crosshair');return false;">crosshair</a>
<a id="e1t" href="#" style="cursor: text;" onclick="setCursorByID('e1','text');return false;">text</a>
<a id="e1a" href="#" style="cursor: default;" onclick="setCursorByID('e1','default');return false;">default</a>
<a id="e1a" href="#" style="cursor: pointer;" onclick="setCursorByID('e1','pointer');return false;">pointer</a>
<a id="e1a" href="#" style="cursor: auto;" onclick="setCursorByID('e1','auto');return false;">auto</a>
</div>
<div>
<a id="e1" href="#" onclick="setCursorByID('e1','help');return false;">test</a>
</div>
</body>
</html>
原文:http://www.javascripter.net/faq/stylesc.htm
JavaScript Set Cursor Style的更多相关文章
- JavaScript动态操作style
1.易错:修改元素的样式不是设置class属性,而是className属性.class是JS的一个保留关键字. 2.易错:单独修改样式的属性使用"style.属性名"3.注意在cs ...
- Maintainable JavaScript(编写可维护的JavaScript) PART I Style Guidelines
“Programs are meant to be read by humans and only incidentally( 顺便:偶然地:附带地) for computers to execute ...
- Javascript动态创建 style 节点
有很多提供动态创建 style 节点的方法,但是大多数都仅限于外部的 css 文件.如何能使用程序生成的字符串动态创建 style 节点,我搞了2个小时. 静态外部 css 文件语法: @import ...
- 原生JavaScript HTML DOM Style 对象参考
Style 对象属性 可以在Style对象上使用以下属性: “CSS”列指示定义属性的CSS版本(CSS1,CSS2或CSS3). 属性 描述 CSS alignContent 当项目不使用所有可用空 ...
- javascript中的style只能取到在HTML中定义的css属性
如果在css中定义的 li{ width:100px; left:100px; top:; position:absolute; font-style:normal; } 这样执行: oli[0].s ...
- JavaScript HTML DOM Style flexWrap 属性
flexWrap 属性 flexWrap属性指定flex项是否应该换行. 注意:如果元素不是flex项,则flexWrap属性不起作用. 如果必要,使flex换行: document.getEleme ...
- style="visibility: hidden" 和 style=“display:none”区别
大多数人很容易将CSS属性display和visibility混淆,它们看似没有什么不同,其实它们的差别却是很大的. visibility属性用来确定元素是显示还是隐藏的,这用visibility=& ...
- 【温故而知新-Javascript】使用事件
1. 使用简单事件处理器 可以用几种不同的方式处理事件.最直接的方式是用事件属性创建一个简单事件处理器(simple event handler).元素为它们支持的每一种事件都定义了一个事件属性.举个 ...
- 使用JavaScript创建我的分页
把下面的方法放到一个js文件,页面引用他就行了 JavaScript function PageList(PageSize, PageIndex, TotalCount, ParList) { $(& ...
随机推荐
- Cloudera Manager Free Edition 4.1 和CDH 4.1.2 简易安装教学
转载:http://fenriswolf.me/2012/12/06/cloudera-manager-free-edition-4-1-和-cdh-4-1-2-简易安装教学/ 安装及管理一个大的Ha ...
- Ribbon1: 在Office菜单中添加项目
Office菜单就是应用程序窗口左上角的一个小的应用程序按钮,这个按钮被称作Office按钮,包含一些通用的操作或命令,例如打印.保存和发布.定制Office菜单时,其下的命令将影响整个文档,而不是文 ...
- SQL Server服务启动失败,错误代码:10048
今天打开电脑后遇到了一个奇葩的问题,启动Sql Server服务时,出现如下图所示错误:
- PHP学习笔记十二【数组排序】
<?php $arr=array(0,5,-1); $temp=0; for($i=0;$i<count($arr)-1;$i++) { for($j=0;$j<count($arr ...
- 工厂方法配置jdbc连接
package 配置方式.dbUtils; import java.io.InputStream; import java.sql.Connection; import java.sql.Driver ...
- pl sql练习(1)
编写函数接受参数并返回字符串:Hello $var.然后赋值给绑定变量并打印: create or replace function hello_function ( pv_whom varchar2 ...
- python面向对象(上)
创建类 Python 类使用 class 关键字来创建.简单的类的声明可以是关键字后紧跟类名: class ClassName(bases): 'class documentation string' ...
- UVA 1839 Alignment
还是最长上升子序列... 本题是求队列中任一士兵都能从左边或者右边看到队伍外: 即某一士兵左边为上升子序列,右边为下降子序列.求两个序列和,再用总数减去: #include <iostream& ...
- XML的Schema约束
XSD文档至少要包含:schema根元素和XML模式命名空间的定义.元素定义.需要注意的是XSD中必须定义一个且只能定义一个schema根元素,根元素中包括模式的约束,XML模式命名空间的定义,其他命 ...
- 【写一个自己的js库】 4.完善跨浏览器事件操作
1.阻止冒泡. function stopPropagation(event){ event = event || getEvent(event); if(event.stopPropagation) ...