这里有新鲜出炉的 Javascript 教程,程序狗速度看过来!
Javascript 是一种由 Netscape 的 LiveScript 发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如 Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
javascript 垂直弹性菜单
[Ctrl+A 全选 注:
- <html>
- <head>
- <style type="text/CSS">
- body {cursor:hand; margin:0; padding:0; position:absolute; overflow:hidden;
- left:0; top:0; width:100%; height:100%;} .link {position:absolute;left:0;width:100%;height:0;background:#000;overflow:hidden;visibility:hidden;}
- .title {position:relative;cursor:pointer;background:#FF6600;width:100%;color:#fff;font-family:trebuchet
- MS;verdana;font-size:11px;left:2;height:15;overflow:hidden;} .title_o {position:relative;cursor:pointer;background:#fff;width:100%;color:#000;font-family:trebuchet
- MS;verdana;font-size:11px;left:2;height:15;overflow:hidden;} .text {position:relative;text-align:justify;margin:10px;font-family:trebuchet
- MS;verdana;font-size:11px;color:#FFF;overflow:hidden;height:90%} .fernando
- { font-family: "Trebuchet MS", Geneva, Arial, Helvetica, san-serif; font-size:
- 16px; font-weight: bolder} .mafra { }
- </style>
- <script type="text/javascript">
- < !--
- var object = new Array();
- function Slide(N, oCont) {
- this.N = N;
- this.S = 1.1;
- this.object = new Array();
- this.CObj = function(parent, N) {
- this.parent = parent;
- this.N = N;
- this.obj = parent.frm[N];
- this.tit = this.obj.firstChild;
- this.div = this.obj.getElementsByTagName("div")[1];
- this.div.style.visibility = "hidden";
- this.y0 = N * 18;
- this.Y1 = this.y0;
- this.obj.style.top = this.y0;
- this.obj.style.height = parent.H - (parent.NF - 1) * 18 - 3;
- this.obj.style.visibility = "visible";
- this.obj.parent = this;
- this.run = false;
- this.move = function() {
- with(this) {
- dy = (y1 - y0) / parent.S;
- if (Math.abs(dy) > .1) {
- y0 += dy;
- obj.style.top = Math.round(y0);
- setTimeout("object[" + parent.N + "].object[" + N + "].move();", 16);
- } else {
- run = false;
- if (dy > 0) div.style.visibility = "hidden";
- else if (N > 0) parent.object[N - 1].div.style.visibility = "hidden";
- }
- }
- }
- this.obj.onmouseover = function() {
- with(this.parent) {
- if (!run) {
- run = true;
- div.style.visibility = "visible";
- for (i = 0; i < parent.NF; i++) parent.object[i].tit.className = "title";
- tit.className = "title_o";
- for (i = 0; i <= N; i++) {
- parent.object[i].y1 = i * 18;
- parent.object[i].move();
- }
- for (i = N + 1; i < parent.NF; i++) {
- parent.object[i].y1 = parent.H - (parent.NF - i) * 18;
- parent.object[i].move();
- }
- }
- }
- }
- }
- this.frm = document.getElementById(oCont);
- this.H = parseInt(this.frm.style.height);
- this.frm = this.frm.getElementsByTagName("span");
- this.NF = this.frm.length;
- for (i = 0; i < this.NF; i++) this.object[i] = new this.CObj(this, i);
- this.object[0].obj.onmouseover();
- this.S = 10;
- }
- onload = function() {
- object[0] = new Slide(0, "frames");
- }
- //-->
- </script>
- </head>
- <body bgcolor="#333333">
- <div>
- <div>
- <div>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_logo_home.gif"
- width="191" height="189" border="0" data-src="">
- </div>
- <div>
- <b>
- alimentos /
- <i>
- food
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-01.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- bebidas /
- <i>
- drinks
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-02.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- joias /
- <i>
- jewels
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-03.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- natureza /
- <i>
- nature
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-04.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- gente /
- <i>
- people
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-05.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- produtos /
- <i>
- products
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_home-06.jpg"
- width="183" height="174" border="0" data-src="">
- </div>
- <div>
- <b>
- contato /
- <i>
- contact
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_assina_home.gif"
- width="191" height="189" border="0" data-src="">
- </div>
- <div>
- <b>
- contato /
- <i>
- contact
- </i>
- </b>
- </div>
- <div>
- <img class="img-responsive" src="http://www.mafra.fot.br/photos/images/img_assina_home.gif"
- width="191" height="189" border="0" data-src="">
- </div>
- </div>
- </div>
- <div>
- </div>
- <script type="text/javascript">
- _uacct = "UA-1182901-1";
- urchinTracker();
- </script>
- </body>
- </html>
如需引入外部 Js 需刷新才能执行
]来源: http://www.phperz.com/article/17/0612/287581.html