为了账号安全,请及时绑定邮箱和手机立即绑定
var logins=document.getelemtnbyid("loginstart), ulst=document.getelemtnbyid("loginstatrpanel);
lis=ulli.getelemtntbytagname("li); tex=docuemnt.getelemtntbyid("login2qq-start-tex); logins.onclick=function(){ulli.style.display="block;} for(var i=0; i<li.length; i++){li[i].onmouseover=function()}
maxy =h-panel.offsetHeight; if(l<0){left=0;}else if(l>maxW){l = maxW;} d ocument.onmouseup=function(){document.onmouseover=null; document.onmouseup=null; }var close=document.getELEMTNById("oclose)"; close.click=funnction(){document.getelemtnbyid("loginpan)".style.display="none";)}
function fnmove(e,posX,posY){var pan =document.getElementById("panel); l=e.clientX-posX; t=e.clientY-posY; panel.style.left=l+"px; panel.style.top=t+"px; w=document.documentelemtn.CLIENTwIDTh h=document.documentElement.clientHeight||document.body.clientHeight; maxw=w-panel.offsetwidth; }
还有一个bug就是鼠标鼠标只要按一次,松手了它也不停跑
function fndown(event){event =event||window.event; var panel =document.getELementById("loginppan); dix=event.clientX-panel.offsetLeft, diy=event.clienty-offsetTop; //关标到面板的距离 document.onmousemove=function(event){event =event||window.event; fn(event,dix,diy); } }
function getname(classn, parent){var open = parent?document.getElementById("parent"):document; all=[]; elements =open.getElementByTagName("*"); for(var i=0; i<elements.length; i++){if(elements[i].className=class; all.push(elements[i]))} return all;} window.onload=drag;
function drag(){
var
}
每次做题目都不会写,看了答案又觉得能懂,这是怎么回事?会了还是不会?
{event.preventDefault();}else{event.returnValue=false;}} stopPropagation:function(event){if(event.stopPropagation){event.stoppropagation();}else{event.cancelBabble=true;}} getType=function(event){return event.type; } getelement:function(event){return event.target||event.srcElement; }
ie eve =event.target||event.srcElemtnt; function (event){event.stoppropagation()} var event=event||window.wvent; canceBubble true false return value false getevent:function(event){return event?event:window.event}, preventDefualt:function(event){if(event.preventDefault)
eventuti.addhander(box,"click",showMEs);封装的 box.addeventlistener("click,newmes,false);么封装的费ie box.attacheventlistener(box,newMes); ie
var event={addhander:function(element,type,hander){if(elemetn.addEventListener{elenent.addeventlistenter(type,hander,false; else if(element.attachEvent){element.attachEvent("on"+type,hander);else{elemtnet['on'+type=hander;]}}})
}}
ie要加on btn3.attachEvent('onclick',showmes); detachEvent("onclick",showMES);
<input type="button" value="anniu" id="new3"> var btn =document.getElementById("btn");
btn.addeventListener() btn1.onclick=null btn.removerEventListener("click",show,false);
接收3参数 :要处理事件名click 事件处理函数functions 布尔值true
addEventListener removeEventListener dom2级事件处理程序方法
课程须知
1.你一定对HTML+CSS比较熟悉; 2.掌握一定的JS基础知识,尤其是函数封装、调用等知识。
老师告诉你能学到什么?
DOM事件具体相关知识,DOM事件的使用方法及应用!

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消