javascript

位置:IT落伍者 >> javascript >> 浏览文章

Js鼠标跟随代码小手点击


发布日期:2018年02月14日
 
Js鼠标跟随代码小手点击

<!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "

<html xmlns="<head><meta httpequiv="ContentType" content="text/html; charset=utf" /><title>可爱的鼠标跟随</title><style>html{ background:#;}bodyhtmlinput{ cursor:none;}bodyhtml{ height:%;}#cursor{ position:absolute; left:px; top:px; display:block;}</style><script>windowonload = function(){ var oCursor = documentgetElementById("cursor"); documentonmousemove=function (ev){ var oEvent=ev||event oWidth = documentdocumentElementclientWidth oHeight = documentdocumentElementclientHeight scrollTop=documentdocumentElementscrollTop + oEventclientY scrollLeft=documentdocumentElementscrollLeft + oEventclientX; if(scrollTop > oHeightoCursoroffsetHeight){ oCursorstyletop = oHeightoCursoroffsetHeight+px; }else if(scrollTop < ){ oCursorstyletop = ; }else{ oCursorstyletop = scrollTop+px; } if(scrollLeft > oWidthoCursoroffsetWidth){ oCursorstyleleft = oWidthoCursoroffsetWidth+px; }else{ oCursorstyleleft = scrollLeft+px; } documentonmousedown = function(){ oCursorinnerHTML = "<img src= />"; return false; } documentonmouseup = function(){ oCursorinnerHTML = "<img src= />"; } };}</script></head><body><div id="cursor"><img src="<input type="button" style="fontsize:px; margin:px;" value="点击" onclick="windowopen()" /></body></html>

上一篇:jquery ui dialog实现弹窗特效的思路及代码

下一篇:你的jquery ajax无效和你的jquery引入路径有关