设为首页设为首页
 添加收藏添加收藏
 进入音乐版音 乐 版
  汉南在线网页设计HTML/CSS

鼠标划过通过CSS图层变色
作  者:匿名
关键字:CSS、DIV



<!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>无标题文档</title>
<style type="text/css">
      <!--
       #test1{
           width:50%;
           margin:0px auto;
           padding:5px;
       }
       .border1{
           background:#ADE9AE ;
           border:dotted 1px #ff0000;
       }
       .border2{
           background:#ffffff;
           border:solid 1px #00ff00;
       }
      -->
</style>
<script type="text/javascript">
 function changeColor(){
  var test;
  test=document.getElementById("test1");
  test.onmouseover=function(){
   test.className='border1';
  }
  test.onmouseout=function(){
   test.className='border2';
  }
 }
 window.onload=changeColor;
</script>
</head>
<body>
<div id="test1" class="border2">
           getElementById(参数)---根据页面项目的id,取得该对象,对象是唯一的。getElementsByName(参数)---根据页面项目的名字,取得对象集合。
        </div>
</body>
</html>
<a href="http://js.alixixi.com/">欢迎访问阿里西西网页特效代码站,js.alixixi.com</a>


来源:网络
阅读:12
日期:2008-5-12

【 双击滚屏 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:不用圆角图片制作的圆角效果
下一篇:导航标签位于右侧的纵向选项卡

  >> 相关文章
 
  ·不用圆角图片制作的圆角效果
  ·自动往下伸展开和收缩的动态图层效果
  ·值得收藏的带自动选项卡生成的后台管理界面
  ·仿网易div+css滑动门选项卡效果
  ·用css制作扑克牌
  ·一个简单的网页选项卡效果菜单
  ·CSS+JS实现的选项卡效果(html组件)
  ·windows选项卡效果(网页展示应用版)
授权使用:汉南在线 http://www.hzwz.net/(2008-2009)   
Copyright (c) 2002-2007 汉南在线. All Rights Reserved . 
经营许可证:陕ICP备05000109号 Powered by:汉南在线