-
鼠标简单跟随提示二
- function id(s){
- return document.getElementById(s);
- }
-
- function mouseFollow() {
- var e = e ? e : window.event;
- var posx = e.clientX;
- var posy = e.clientY;
- var followDiv = id("followDiv") ? id("followDiv"): document.createElement("div");
- followDiv.setAttribute("id","followDiv");
- var css = "100px;height:20px;border:1px solid grey;position:absolute;z-index:10000;left:"+posx+";top:"+posy+";";
- setCss(followDiv,css);
- document.body.appendChild(followDiv);
- }
-
- function getStyle(element, name) {
- var computedStyle;
- try {
- computedStyle = document.defaultView.getComputedStyle(element,
null);
- } catch (e) {
- computedStyle = element.currentStyle;
- }
- if (name != "float") {
- return computedStyle[name];
- } else {
- return computedStyle["cssFloat"] || computedStyle["styleFloat"];
- }
- }
-
- function setStyle(element, name, value) {
- if (name != "float") {
- element.style[name] = value;
- } else {
- element.style["cssFloat"] = value;
- element.style["styleFloat"] = value;
- }
- }
-
- function setCss(obj,css){
- obj.setAttribute("style",css);
- obj.style.cssText = css;
- }
-
相关阅读:
Redis的分布式锁
Redis的雪崩、击穿、穿透
psr规范
Mysql的联(复)合索引
nginx的location配置(二)
nginx的location规则(一)
easyswoole中队列的使用
第三章 文件I/O
移动语义及拷贝优化
PHP对接tdzntech.com云平台电子免费券程序
-
原文地址:https://www.cnblogs.com/bjanzhuo/p/3576101.html
Copyright © 2020-2023
润新知