易截截图软件、单文件、免安装、纯绿色、仅160KB

一个css javascript的二级横向菜单

  演示地址: http://www.wowo-design.com/view/51_01/index.htm
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css菜单演示</title>
<style type="text/css">
<!--
*{margin:0;padding:0;border:0;}
body {
  font-family: arial, 宋体, serif;
font-size:12px;
}
#nav {
   line-height: 24px; list-style-type: none; background:#666;
}
#nav a {
  display: block; width: 80px; text-align:center;
}
#nav a:link {
  color:#666; text-decoration:none;
}
#nav a:visited {
  color:#666;text-decoration:none;
}
#nav a:hover {
  color:#FFF;text-decoration:none;font-weight:bold;
}
#nav li {
  float: left; width: 80px; background:#CCC;
}
#nav li a:hover{
  background:#999;
}
#nav li ul {
  line-height: 27px; list-style-type: none;text-align:left;
  left: -999em; width: 980px; position: absolute; float:left;
}
#nav li ul li{
  float: left; width: 80px;
  background: #F6F6F6;
}
#nav li ul a{
  display: block; width: 80px;text-align:center;
}
#nav li ul a:link {
  color:#666; text-decoration:none;
}
#nav li ul a:visited {
  color:#666;text-decoration:none;
}
#nav li ul a:hover {
  color:#F3F3F3;text-decoration:none;font-weight:normal;
  background:#C00;
}
#nav li:hover ul {
  left: 0;
}
#nav li.sfhover ul {
  left: 0;
}
#content {
  clear: left;
}
-->
</style>
<script type=text/javascript><!--//--><![CDATA[//><!--
function menuFix() {
  var sfEls = document.getElementById("nav").getElementsByTagName("li");
  for (var i=0; i<sfEls.length; i++) {
    sfEls[i].onmouseover=function() {
    this.className+=(this.className.length>0? " ": "") + "sfhover";
&nb


相关文档:

JavaScript 获取对象的高度和宽度详细说明

scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......

javascript的OO继承


在prototype框架中的类继承实现机制
//为Object类添加静态方法:extend
Object.extend = function(destination, source) {
  for(property in source) {
     destination[property] = source[property];
  }
  return destination;
}
//通过Object类为每个对象添加方法 ......

javascript 获取css 属性

 我们有时获取 styl.width为空的时候,可以获取css中的width..
但ie and ff 是不同的。。
ie:
obj.currentStyle['width'] 
ff:
var css = document.defaultView.getComputedStyle(obj, null);  
css.getPropertyValue('width')  ......

javascript 文本框刷新的时候保存文本值

 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号