这里有新鲜出炉的 Javascript 教程,程序狗速度看过来!
Javascript 是一种由 Netscape 的 LiveScript 发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如 Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
鼠标跟随效果, 好多用于广告点击, 提示效果
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <title>
- Untitled Document
- </title>
- </head>
- <body>
- <img class="img-responsive" src="http://img.phperz.com/data/img/20170322_6/1490193452_7501.gif"
- data-src="">
- </body>
- <html>
- <script type="text/javascript">
- document.onmousemove = function(e) {
- var e = e ? e: window.event;
- var posx = e.clientX;
- var posy = e.clientY;
- document.images[0].style.left = posx + "px";
- document.images[0].style.top = posy + "px";
- }
- </script>
来源: http://www.phperz.com/article/17/0718/287879.html