时间: 2021-07-31 作者:daque
第一集 怎样用滑鼠遏制web页面 在这一局部开始要为你展现的javascript个性是将你的滑鼠移到这个各别脸色的连结上头,此时看看欣赏器下的状况列有何截止,而后如许的功效咱们不妨与javascript的功效相贯串。还好吗做到的呢 以次即是这一个连结的作法: <a href="tpage.htm" onmouseover="window.status='just another stupid link...'; return true"> 在这边你只有在保守 <a> 的标签中介入 onmouseover 的 method 就可完毕你要的功效了。这边的 window.status 是用来让你不妨在 www 欣赏器的状况列上表露少许消息用的。 在语法中,你不妨看到消息局部是用 ' 括起来的局部,而非以 " 括起来。在消息局部中断之后,必需加上 ; return true。好了,运用之上的个性不妨很大略的实行第二个连结的例子,十分大略。以onmouseover 的 method ,而后共同事变爆发时去呼唤因变量 hello() 就行了,不复多加证明了。 作法如次 <html> <head> <script language="livescript"> <!-- hiding function hello() { alert("哈罗!"); } </script> </head> <body> <a href="" onmouseover="hello()">link</a> </body> </html>