当前位置: 代码迷 >> .NET相关 >> 图片选中出现框子效果
  详细解决方案

图片选中出现框子效果

热度:92   发布时间:2016-04-24 02:48:26.0
图片选中出现边框效果

图片选中出现边框效果:

当点击选中图片时,图片能够出现红色的边框效果。

代码实例如下:

<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="author" content="http://www.51texiao.cn/" /><title>蚂蚁部落</title><style type="text/css"> #mainboard img{   border:1px solid #cccccc;    width:88px;    height:31px;    cursor:pointer; } </style> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script><script type="text/javascript"> $(function(){    $("#mainboard img").bind("click",function(){        $(this).css("border","1px solid red").siblings().css("border","1px solid #cccccc");    }) }) </script> </head> <body> <div id="mainboard">   <img src="1.gif" class="b" />   <img src="2.gif" />   <img src="3.gif" />   <img src="4.gif" /> </div> </body> </html>

原文地址是:http://www.51texiao.cn/jqueryjiaocheng/2015/0504/687.html

最为原始地址是:http://www.softwhy.com/ 

  相关解决方案