|
| |
精品推荐 |
 |
|
| |
|
|
|
|
Js之软键盘实现(源码)
|
日期:2007年2月3日 作者: 查看:[大字体
中字体 小字体]
|
59if(diffY != lastScrollY) { 60percent = .1 * (diffY - lastScrollY); 61if(percent > 0) percent = Math.ceil(percent); 62else percent = Math.floor(percent); 63if(IE) document.all.softkeyboard.style.pixelTop += percent; 64if(NS) document.softkeyboard.top += percent; 65lastScrollY = lastScrollY + percent;} 66if(diffX != lastScrollX) { 67percent = .1 * (diffX - lastScrollX); 68if(percent > 0) percent = Math.ceil(percent); 69else percent = Math.floor(percent); 70if(IE) document.all.softkeyboard.style.pixelLeft += percent; 71if(NS) document.softkeyboard.left += percent; 72lastScrollX = lastScrollX + percent; } } 73function checkFocus(x,y) { 74stalkerx = document.softkeyboard.pageX; 75stalkery = document.softkeyboard.pageY; 76stalkerwidth = document.softkeyboard.clip.width; 77stalkerheight = document.softkeyboard.clip.height; 78if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true; 79else return false;} 80function grabIt(e) { 81checkSoftKey = false; 82if(IE) { 83whichIt = event.srcElement; 84while (whichIt.id!=null&&whichIt.id.indexOf("softkeyboard") == -1) { 85whichIt = whichIt.parentElement; 86if (whichIt == null) { return true; } } 87if(whichIt.style!=null){ 88whichIt.style.pixelLeft = whichIt.offsetLeft; 89whichIt.style.pixelTop = whichIt.offsetTop; 90} 91currentX = (event.clientX + document.body.scrollLeft); 92currentY = (event.clientY + document.body.scrollTop); 93} else { 94window.captureEvents(Event.MOUSEMOVE); 95if(checkFocus (e.pageX,e.pageY)) { 96whichIt = document.softkeyboard; 97StalkerTouchedX = e.pageX-document.softkeyboard.pageX; 98StalkerTouchedY = e.pageY-document.softkeyboard.pageY;} } 99return true; } 100function moveIt(e) { 101if (whichIt == null) { return false; } 102if(IE) { 103if(whichIt.style!=null){ 104newX = (event.clientX + document.body.scrollLeft); 105newY = (event.clientY + document.body.scrollTop); 106distanceX = (newX - currentX); distanceY = (newY - currentY);
上一篇:ASP.NET Forums 页面模型分析
下一篇:ASP.NET 无法确保在注册的 JavaScript 内不存在重复定义
|
| Js之软键盘实现(源码) 相关文章: |
|
|
|
| Js之软键盘实现(源码) 相关软件: |
|
|
|
|