推荐新闻
简单JS制作div的边框随鼠标变色
发布者:深蓝互联
发布时间:2015-01-23
点击:

<html>
 <head>
  <style type="text/css">
  .szdbi1 {
    width:275px;
    height:150px;
    color: red;
    border: 1px solid red;
  }
  .szdbi{
    width:275px;
    height:150px;
    color: red;
    border: 1px solid black;
  }

  </style>
  <script language="javascript">
   function hc(obj,cssname) {
 obj.className = cssname; //obj为对象名,cssname为对象的class名
   }
</script>
 </head>
 <body>
  <div  onMouseOver="hc(this,'szdbi1');" onMouseOut="hc(this,'szdbi');" class="szdbi">
     <img src="http://www.szdbi.com/skin/default/images/LINK_logo.png" />
     <p><a href="http://www.szdbi.com">深蓝互联测试</a></p>
 
  </div>
 </body>
</html>

 

文章来自深蓝互联http://www.szdbi.com/WEBkaifajishu/2015-01-23/46.html转载请注明出处!

关注深蓝互联公众号
Copyright © 2013-2025 深蓝互联 版权所有
友情链接: