转载自:http://blog.csdn.net/zhaoxiao2008/article/details/7908950
获取html绝对坐标
- <SPAN style="FONT-SIZE: 24px">function findPosition(oElement) {
- var x2 = 0;
- var y2 = 0;
- var width = oElement.offsetWidth;
- var height = oElement.offsetHeight;
- //alert(width + "=" + height);
- if (typeof (oElement.offsetParent) != 'undefined') {
- var posY = 0
- for ( var posX = 0; oElement; oElement = oElement.offsetParent) {
- posX = posX + oElement.offsetLeft;
- posY = posY + oElement.offsetTop;
- }
- x2 = posX + width;
- y2 = posY + height;
- return [ posX, posY, x2, y2 ];
- } else {
- x2 = oElement.x + width;
- y2 = oElement.y + height;
- return [ oElement.x, oElement.y, x2, y2 ];
- }
- }
- </SPAN>
function findPosition(oElement) {
var x2 = 0;
var y2 = 0;
var width = oElement.offsetWidth;
var height = oElement.offsetHeight;
//alert(width + "=" + height);
if (typeof (oElement.offsetParent) != 'undefined') {
var posY = 0
for ( var posX = 0; oElement; oElement = oElement.offsetParent) {
posX = posX + oElement.offsetLeft;
posY = posY + oElement.offsetTop;
}
x2 = posX + width;
y2 = posY + height;
return [ posX, posY, x2, y2 ];
} else {
x2 = oElement.x + width;
y2 = oElement.y + height;
return [ oElement.x, oElement.y, x2, y2 ];
}
}
屏蔽Ctrl+V 屏蔽Ctrl+V
- <SPAN style="FONT-SIZE: 24px">function NoPaste(){ //屏蔽 Ctrl+V
- if ((event.ctrlKey)&&(event.keyCode==86))
- {
- event.keyCode=0;
- event.returnValue=false;
- }
- };
- </SPAN>
function NoPaste(){ //屏蔽 Ctrl+V
if ((event.ctrlKey)&&(event.keyCode==86))
{
event.keyCode=0;
event.returnValue=false;
}
};
按回车键直接登录
- <SPAN style="FONT-SIZE: 24px">
- function document.onkeydown()
- {
- if(event.keyCode == 13 && 'resetid' != document.activeElement.id)
- {
- try{
- LoginIn();
- }catch(e){
- }
- }
- } </SPAN>
function document.onkeydown()
{
if(event.keyCode == 13 && 'resetid' != document.activeElement.id)
{
try{
LoginIn();
}catch(e){
}
}
}