O evento é incompatível com o IE e o FF. Hoje encontrei alguns problemas com a transmissão. Consulte alguns métodos online e tenha alguma experiência:
aclassarRray [i] .onMouseOver = function () {// Não há problema em escrever o código diretamente nele. Você também pode passar os parâmetros a passar, mas não é conveniente reutilizar}; AcLASSARRAY [i] .onMouseOver = linkMouseOver // pode ser usado sem parâmetros de passagem, mas não pode ser usado nos argumentos futuros.callee.caller.arguments [0] aclassarray [i] .onmouseOver = linkMouse () // PutriCheRs é um uso incorreto (usectrage aclArray [i]. }; // Isso pode ser passado, você pode alertá -lo, mas o evt.clientX + há um problema com "px" e está vazio. . . argumentos.callee.caller.argudents [0] // Você pode usá -lo para resolver var src = evt.srcelement || Evt.target; // você também pode seguir o SRC======================================================================================================
Código de exercício anexado
<! Doctype html> <html> <head> <title> </title> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> link Rel = "StyleSheet" href = "css/ui-lightness/jQuery-ui-uii-us-rels-rel =" soll. /> <script src = "js/jQuery-1.10.2.js"> </script> <script src = "js/jQuery-ui-1.10.4.custom.js"> </script> <style type = "text/css">. #0094FF;}. Tips "," Google ":" Google Site Prompt "} var ATAG = document.getElementsByTagName (" A "); var AcLASSARRAY = []; para (var i = 0; i <atag.Length; i ++) {if (ATAG [i] .class ==" Aclass ") {ACLArray [AclArray = 0; argumentos.callee.caller.argudents [0]; // obtenha o objeto de evento divtips.className = "divtips"; divtips.style.left = evt.clientx + "px"; // + px compatível com ffdivtips.style.top = evt.clienty + "px"; // + px "test"; document.getElementById ("Diva"). ApndendChild (Divtips);} função linkMouseOut () {var divTag = document.getElementsByTagName ("div"); para (var i = 0; i <divtag.Length; i ++) {if (divTag [i]. {Document.getElementById ("Diva"). RemoveChild (Divtag [i]);}}} window.onload = initonover; </script> </adge> <body> <div id = "diva"> <a href = "http://www.baidu.com" Rel = "NOFLUGHT"> href = "http://www.163.com" rel = "Nofollow externo"> netEase </a> <r/> <r/> <r/> <a href = "http://www.google.com" rel = "nofollow"> google </a> </div> </body.com "