好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

图片选中效果_html/css_WEB-ITnose

CSS

求QQ中上传照片,选中照片特效效果,如图所示

最好有整个相片框的示例代码。


回复讨论(解决方案)

这个用js做更简单吧

js点击后给容器增加一个样式,这个样式显示那个钩钩背景就行,再次点击取消这个样式





上传图片

*{margin:0;padding:0;}
body{font-size:12px;}
ul{list-style:none;}

#imgbox{width:450px;margin:100px auto; overflow:hidden;zoom:1;}
#imgbox ul li{width:120px; height:100px; float:left; margin-right:10px; margin-bottom:10px; border:1px solid #fff; padding:30px 2px; cursor:pointer;}
#imgbox ul li img{width:120px; height:100px;}
#imgbox ul li.current{border:1px solid #5d90ab; background:url(images/ok.jpg) 0 0 no-repeat;}


window.onload=function(){
var oDiv = document.getElementById('imgbox');
var oUl = oDiv.getElementsByTagName('ul')[0];
var oLi = oUl.getElementsByTagName('li');
for(var i = 0; i oLi[i].onclick=function(){
/* for(var i = 0; i oLi[i].className='';
}*/
this.className='current';
}
}
}













查看更多关于图片选中效果_html/css_WEB-ITnose的详细内容...

  阅读:40次