function getByclass(clsName,parent) {
var oParent=parent?document.getElementById(parent):document,
eles=[],
elements=oParent.getElementsByTagName('*');
for(var i=0,l=elements.length;i<1;i++){
if(elements[i].className==clsName){
eles.push(elements[i]);
}
}
return eles;
}
window.onload=drag;
function drag() {
var oTitle=getByclass('login_logo_webqq','loginPanel')[0];
oTitle.onmousedown=fnDown;
}
function fnDown(argument) {
var oDrag=docuemnt.getElementById('loginPanel');
document.onmousemove=function (event) {
event = event || window.event;
oDrag.style.left=event.clientX+'px';
oDrag.style.top=event.clientY+'px';
}
}
stone310
相关分类