php做五星评价系统,CSSGAMES:纯CSS实现五星评价效果

上图:

27775098b19d9d968b6166c99f1b2452.gif

上代码:

.container{

width: 150px;

height: 30px;

position: relative;

}

.container ul{

margin: 0;

padding: 0;

position: absolute;

list-style: none;

width: 100%;

height: 100%;

overflow: hidden;

}

.container li{

z-index: 1;

width: 20%;

height: 100%;

float: left;

background: #faf;

border-radius: 50%;

/*box-shadow: 2px red inset;*/

}

.container li:hover+span{

display: block;

z-index: 99;

width: 500%;

height: 100%;

float: left;

background: #afa;

}

span.show{

display: block;

z-index: 99;

width: 500%;

height: 100%;

float: left;

background: #afa;

}

.backer{

position: absolute;

width: 100%;

height: 100%;

}

.backer li{

background: #999;

}

another div

var spans=[];

var form =$("form")

$(".container li").on("click",function(e){

console.log(e.target.className.split("i")[1]);

// form.star.value=e.target.className.split("i")[1];

console.log($("."+e.target.className).next());

$("."+e.target.className).next().addClass("show");

spans=$("span.show");

})

$(".container ul").mouseenter(function(){

if(spans.length>0)spans.removeClass("show");

console.log(spans);

})

$(".container ul").mouseleave(function(){

spans.addClass("show")

})

没了。

PS:大力推荐《CSS揭秘》,一本让人钻牛角尖不亦乐乎的书

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值