css活用,评分点击星星

1、字符图集

2、css样式

.cleanfloat::after{display: block; clear: both; content:""; visibility: hidden; height: 0;}/*清浮动*/
 ul li{list-style:none; float:left; font-size:30px; margin:5px; color:#ccc; cursor:pointer;}/*五角星样式*/
.hs,.cs{color:#f00;}/*五角星点击后样式*/

3、HTML

<ul class="cleanfloat">
      <li>★</li>
      <li>★</li>
      <li>★</li>
      <li>★</li>
      <li>★</li>
</ul>

4、JS

    $(function () {
        $("ul li").hover(function(){
            $(this).addClass(‘hs‘);
            $(this).prevAll().addClass(‘hs‘);
        },function(){
            $(this).removeClass(‘hs‘);
            $(this).prevAll().removeClass(‘hs‘);
        })

        $("ul li").click(function () {
            $(this).addClass(‘cs‘);
            $(this).prevAll().addClass(‘cs‘);
            $(this).nextAll().removeClass(‘cs‘);
        })
    })

  

时间: 2024-08-29 20:26:31

css活用,评分点击星星的相关文章

js星级评分点击星级评论打分效果--收藏--转载

<!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-

Div+Css(2):纯Div+Css制作的漂亮点击按钮和关闭按钮

纯Div+Css制作的漂亮点击按钮和关闭按钮,单击点击按钮也有效果.这些都不是图片. 值得注意三点: 1.其中,主要使用了rotate.它能让文字旋转角度 2.还有radius,做圆角专用,很好用的属性.给想我这样的人省去了作图的时间. 3.W3C标准中对CSS3的transition这是样描述的:"CSS的transition允许CSS的属性值在一定的时间区间内平滑地过渡.这种效果可以在鼠标单击.获得焦点.被点击或对元素任何改变中触发,并圆滑地以动画效果改变CSS的属性值." 1 &

CSS如何去除超链接点击时的虚线

CSS如何去除超链接点击时的虚线:建议:尽可能的手写代码,可以有效的提高学习效率和深度.当点击链接的时候,默认情况下会出现一个虚线框.实例代码如下: <!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title

css活用,半星星的效果

1.首先下载要用到星星字体 http://www.w3cplus.com/w3cplusDemo/demos/webFontIcon.html 2.css .cleanfloat::after{display: block; clear: both; content:""; visibility: hidden; height: 0;} *{margin:0; padding:0;} /*字体路径按照你的路径去修改*/ @font-face { font-family: 'Allura

CSS 兼容手机浏览器 点击蓝色边框

* { -webkit-tap-highlight-color: transparent; -webkit-appearance: none; } CSS放入全局,屏蔽部分手机浏览器 点击链接出现蓝色虚线框.

纯CSS让radio实现点击显示隐藏效果

—————————————————————————————————————————————————————————————————— ———————————————————————————————————————————————————————————————————— ———————————————————————————————————————————————————————————————————— html <style> #faq input[type='radio']{ displ

CSS中input输入框点击时去掉外边框方法【outline:medium;】----CSS学习

CSS 中添加 outline:medium; JS 控制焦点: $("#CUSTOM_PHONE").focus(function(event){ // this.attr("border","none"); $("#CUSTOM_PHONE").css('border-bottom','1px solid #3BC2B5'); }); $("#CUSTOM_PHONE").blur(function(e

css中input输入框点击背景及边框变化

CSS不常用属性果然不用就想不起来啊. 记录一下做个备忘. 用:focus伪类就可以实现 input:focus {     border: 2px solid yellow; }

[CSS揭秘]扩大可点击区域

目的: 想给一个简单的小按钮扩大其热区在四个方向上均向外扩张10px 解决方案: 1. 常规的解决方案可能是设置一圈透明边框. border: 10px solid transparent; 2. 但是如果按钮有背景色,那么边框很可能会扩大按钮的可视尺寸.于是可以采用background-clip属性将背景限制在padding-box区域内. background-clip: padding-box; 3. 如果此时想给按钮添加边框效果如阴影效果,那么只能是添加内阴影.因为外阴影会加在borde