易截截图软件、单文件、免安装、纯绿色、仅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去除前、后、中间空格

=====能去中间==================================================
方法一:(不能去换行等)
代码简洁有力。妙就妙在split函数的使用上。先用空格分割(split)字符串,然后拼接.不得不佩服之,才思敏捷啊。看这样的代码,让人神清气爽。
 function IgnoreSpaces(Str){
    var ResultStr = ""; ......

服务器端javascript弹出对话框和文件、目录操作

//服务器弹出对话框
 if (lcSID == "1" && (txtNsp.Text.Trim() != lcNewspaper || Convert.ToDateTime(txtNspdate.Text.Trim()) != Convert.ToDateTime(lcNspdate)))
        {
            string lcJs = "v ......

javascript 获取css 属性

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

如何在Java 代码中执行 JavaScript

 在实际应用中,可能会碰到这样的情况,需要在Java代码中执行JavaScript。
 例如:
  import java.io.IOException;
import java.io.PrintWriter;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public cl ......

JavaScript 去出字符串中的空格

 
去除字符串左右两端的空格,在
vbscript

面可以轻松地使用
 trim

ltrim 

 rtrim
,但在
js
中却没有这
3
个内置方法,需要手工编写。下面的实现方法是用到了正则表达式,效率不错,并把这三个方法加入
String
对象的内置方法中去。
 
<mce:script type="tex ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号