Cursor的各种效果

总结之后的Cursor的各种效果:

http://sandbox.runjs.cn/show/bbwoyn0c

http://css-cursor.techstream.org/

源代码如下:

 1 <!doctype html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8" />
 5     <title>cursor</title>
 6     <style>
 7         *{
 8             margin: 0;
 9             padding: 0;
10         }
11         #wrap{
12             width:1320px;
13             margin:0px auto;
14             font-family: monospace;
15             font-size: 18px;
16         }
17         .caption{
18             font-size: 30px;
19             text-align: center;
20             font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
21         }
22         div.listcur{
23             width:200px;
24             height:100px;
25             background-color: #ccc;
26             box-shadow:4px 4px 10px #ccc;
27             float: left;
28             text-align: center;
29             line-height: 100px;
30             margin:10px;
31         }
32     </style>
33 </head>
34 <body>
35     <div id="wrap"><div class="caption">Cursor</div></div>
36     <script>
37         ;(function(globel,doc){
38             var curarr = ['auto','default','none','pointer','progress',
39             'help','text','cell','crosshair','alias','context-menu','vertical-text',
40             'copy','move','no-drop','not-allowed','all-scroll','col-resize','row-resize',
41             'nesw-resize','nwse-resize', 'n-resize','e-resize','s-resize','w-resize',
42             'ns-resize','ew-resize','ne-resize','nw-resize','sw-resize','se-resize', 'wait',
43             'grab','grabbing','zoom-in','zoom-out'];
44             var wrap = doc.getElementById('wrap');
45             var length = curarr.length;
46             var d=document.createDocumentFragment();   //创建了一虚拟的节点对象
47             var i = length;
48             for(;i--;){
49                 var div = doc.createElement('div');
50                 div.textContent = curarr[i];
51                 div.className = 'listcur';
52                 style = curarr[i].slice(0,1).toUpperCase()+curarr[i].slice(1).toLowerCase()+';';
53                 div.style.cursor = curarr[i];
54                 div.style.cursor = '-webkit-'+curarr[i] ; 
55                 div.style.cursor = '-moz-'+curarr[i] ; 
56                 d.appendChild(div);
57             }
58             wrap.appendChild(d);
59         }(this,document))
60     </script>
61 </body>
62 </html>

 

转载于:https://www.cnblogs.com/qianduanjingying/p/5579700.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值