jquery鼠标滑过星星区域显示评论信息、评论星星打分jquery特效|jsfoot网页特效 演示

@charset "utf-8";

/* reset */

*{margin:0;padding:0;list-style-type:none;}

a{blr:expression(this.onFocus=this.blur())}/*去掉a标签的虚线框,避免出现奇怪的选中区域*/

:focus{outline:0;}

label{cursor:pointer;}

img{vertical-align:middle;}

table{empty-cells:show;border-collapse:collapse;border-spacing:0;}

h1{font-size:16px;}h2,h3,h4{font-size:14px;}h5,h6{font-size:12px;}

abbr,acronym{border:0;font-variant:normal}

address,caption,cite,code,dfn,em,th,var,optgroup{font-style:normal;font-weight:normal}

input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit}

input,button,textarea,select{*font-size:100%}

a,img{border:0;}

a,a:visited{color:#5e5e5e; text-decoration:none;}

a:hover{color:#4183C4;text-decoration:underline;}

.clear{display:block;overflow:hidden;clear:both;height:0;line-height:0;font-size:0;}

.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}

.clearfix{display:inline-table;}/* Hides from IE-mac \*/

*html .clearfix{height:1%;}

.clearfix{display:block;}/* End hide from IE-mac */

*+html .clearfix{min-height:1%;}

body{font:12px/180% Arial,Lucida,Verdana,"宋体",Helvetica,sans-serif;color:#333;background:#fff;}

/* shortcut */

.shortcut{position:fixed;top:0;left:0;z-index:9999;width:100%;}

*html,*html body /* 修正IE6振动bug */{background-image:url(about:blank);background-attachment:fixed;}

*html .shortcut{position:absolute;top:expression(eval(document.documentElement.scrollTop));}

.shortcut{height:28px;line-height:28px;font-size:12px;background:#EEEEEE;text-transform:uppercase;box-shadow:1px 0px 2px rgba(0,0,0,0.2);border-bottom:1px solid #DDDDDD;}

.shortcut h1{font-size:14px;font-family:"微软雅黑","宋体";}

.shortcut a,.shortcut h1{padding:0px 10px;letter-spacing:1px;color:#333;text-shadow:0px 1px 1px #fff;display:block;float:left;}

.shortcut a:hover{background:#fff;}

.shortcut span.right{float:right;}

.shortcut span.right a{float:left;display:block;color:#ff6600;font-weight:800;}

.headeline{height:40px;overflow:hidden;}

.adv960x90{width:960px;height:90px;overflow:hidden;border:solid 1px #E6E6E6;margin:0 auto;}

.adv728x90{width:728px;height:90px;overflow:hidden;border:solid 1px #E6E6E6;margin:0 auto;}

//屏蔽右键菜单

document.oncontextmenu = function (event){

if(window.event){

event = window.event;

}try{

var the = event.srcElement;

if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){

return false;

}

return true;

}catch (e){

return false;

}

}

jquery鼠标滑过星星区域显示评论信息、评论星星打分jquery特效

下载特效

// star choose

jQuery.fn.rater= function(options) {

// 默认参数

var settings = {

enabled: true,

url: '',

method: 'post',

min: 1,

max: 5,

step: 1,

value: null,

after_click: null,

before_ajax: null,

after_ajax: null,

title_format: null,

info_format: null,

image: 'images/stars.jpg',

imageAll :'images/stars-all.gif',

defaultTips :true,

clickTips :true,

width: 24,

height: 24

};

// 自定义参数

if(options) {

jQuery.extend(settings, options);

}

//外容器

var container= jQuery(this);

// 主容器

var content= jQuery('

content.css('background-image' , 'url(' + settings.image + ')');

content.css('height' , settings.height);

content.css('width' , (settings.width*settings.step) * (settings.max-settings.min+settings.step)/settings.step);

//显示结果区域

var result= jQuery('

container.after(result);

//显示点击提示

var clickTips= jQuery('

点击星星就可以评分了

');

if(!settings.clickTips){

clickTips.hide();

}

container.after(clickTips);

//默认手形提示

var tipsItem= jQuery('

');

tipsItem.css('width' , (settings.width*settings.step) * (settings.max-settings.min+settings.step)/settings.step);

tipsItem.css('z-index' , settings.max / settings.step + 2);

if(!settings.defaultTips){//隐藏默认的提示

tipsItem.hide();

}

content.append(tipsItem);

// 当前选中的

var item= jQuery('

');

item.css('background-image' , 'url(' + settings.image + ')');

item.css('height' , settings.height);

item.css('width' , 0);

item.css('z-index' , settings.max / settings.step + 1);

if (settings.value) {

item.css('width' , ((settings.value-settings.min)/settings.step+1)*settings.step*settings.width);

};

content.append(item);

// 星星

for (var value=settings.min ; value<=settings.max ; value+=settings.step) {

item= jQuery('

');

if (typeof settings.info_format == 'function') {

//item.attr('title' , settings.title_format(value));

item.find(".popinfo").html(settings.info_format(value));

item.find(".popinfo").css("left",(value-1)*settings.width)

}

else {

item.attr('title' , value);

}

item.css('height' , settings.height);

item.css('width' , (value-settings.min+settings.step)*settings.width);

item.css('z-index' , (settings.max - value) / settings.step + 1);

item.css('background-image' , 'url(' + settings.image + ')');

if (!settings.enabled) {// 若是不能更改,则隐藏

item.hide();

}

content.append(item);

}

content.mouseover(function(){

if (settings.enabled) {

jQuery(this).find('.rater-star-item-current').hide();

}

}).mouseout(function(){

jQuery(this).find('.rater-star-item-current').show();

})

// 添加鼠标悬停/点击事件

var shappyWidth=(settings.max-2)*settings.width;

var happyWidth=(settings.max-1)*settings.width;

var fullWidth=settings.max*settings.width;

content.find('.rater-star-item').mouseover(function() {

jQuery(this).prevAll('.rater-star-item-tips').hide();

jQuery(this).attr('class' , 'rater-star-item-hover');

jQuery(this).find(".popinfo").show();

//当3分时用笑脸表示

if(parseInt(jQuery(this).css("width"))==shappyWidth){

jQuery(this).addClass('rater-star-happy');

}

//当4分时用笑脸表示

if(parseInt(jQuery(this).css("width"))==happyWidth){

jQuery(this).addClass('rater-star-happy');

}

//当5分时用笑脸表示

if(parseInt(jQuery(this).css("width"))==fullWidth){

jQuery(this).removeClass('rater-star-item-hover');

jQuery(this).css('background-image' , 'url(' + settings.imageAll + ')');

jQuery(this).css({cursor:'pointer',position:'absolute',left:'0',top:'0'});

}

}).mouseout(function() {

var outObj=jQuery(this);

outObj.css('background-image' , 'url(' + settings.image + ')');

outObj.attr('class' , 'rater-star-item');

outObj.find(".popinfo").hide();

outObj.removeClass('rater-star-happy');

jQuery(this).prevAll('.rater-star-item-tips').show();

//var startTip=function () {

//outObj.prevAll('.rater-star-item-tips').show();

//};

//startTip();

}).click(function() {

//jQuery(this).prevAll('.rater-star-item-tips').css('display','none');

jQuery(this).parents(".rater-star").find(".rater-star-item-tips").remove();

jQuery(this).parents(".goods-comm-stars").find(".rater-click-tips").remove();

jQuery(this).prevAll('.rater-star-item-current').css('width' , jQuery(this).width());

if(parseInt(jQuery(this).prevAll('.rater-star-item-current').css("width"))==happyWidth||parseInt(jQuery(this).prevAll('.rater-star-item-current').css("width"))==shappyWidth){

jQuery(this).prevAll('.rater-star-item-current').addClass('rater-star-happy');

}

else{

jQuery(this).prevAll('.rater-star-item-current').removeClass('rater-star-happy');

}

if(parseInt(jQuery(this).prevAll('.rater-star-item-current').css("width"))==fullWidth){

jQuery(this).prevAll('.rater-star-item-current').addClass('rater-star-full');

}

else{

jQuery(this).prevAll('.rater-star-item-current').removeClass('rater-star-full');

}

var star_count= (settings.max - settings.min) + settings.step;

var current_number= jQuery(this).prevAll('.rater-star-item').size()+1;

var current_value= settings.min + (current_number - 1) * settings.step;

//显示当前分值

if (typeof settings.title_format == 'function') {

jQuery(this).parents().nextAll('.rater-star-result').html(current_value+'分 '+settings.title_format(current_value));

}

$("#StarNum").val(current_value);

//jQuery(this).parents().next('.rater-star-result').html(current_value);

//jQuery(this).unbind('mouseout',startTip)

})

jQuery(this).html(content);

}

// 星星打分

$(function(){

var options= {

max: 5,

title_format: function(value) {

var title = '';

switch (value) {

case 1 :

title= '很不满意';

break;

case 2 :

title= '不满意';

break;

case 3 :

title= '一般';

break;

case 4 :

title= '满意';

break;

case 5 :

title= '非常满意';

break;

default :

title = value;

break;

}

return title;

},

info_format: function(value) {

var info = '';

switch (value) {

case 1 :

info= '

1分 很不满意

商品样式和质量都非常差,太令人失望了!

';

break;

case 2 :

info= '

2分 不满意

商品样式和质量不好,不能满足要求。

';

break;

case 3 :

info= '

3分 一般

商品样式和质量感觉一般。

';

break;

case 4 :

info= '

4分 满意

商品样式和质量都比较满意,符合我的期望。

';

break;

case 5 :

info= '

5分 非常满意

我很喜欢!商品样式和质量都很满意,太棒了!

';

break;

default :

info = value;

break;

}

return info;

}

}

$('#rate-comm-1').rater(options);

});

*{margin:0;padding:0;list-style-type:none;}

a,img{border:0;}

body{font:12px/180% Arial, Helvetica, sans-serif;}

/*quiz style*/

.quiz{border:solid 1px #ccc;height:270px;width:772px;}

.quiz h3{font-size:14px;line-height:35px;height:35px;border-bottom:solid 1px #e8e8e8;padding-left:20px;background:#f8f8f8;color:#666;position:relative;}

.quiz_content{padding-top:10px;padding-left:20px;position:relative;height:205px;}

.quiz_content .btm{border:none;width:100px;height:33px;background:url(images/btn.gif) no-repeat;margin:10px 0 0 64px;display:inline;cursor:pointer;}

.quiz_content li.full-comment{position:relative;z-index:99;height:41px;}

.quiz_content li.cate_l{height:24px;line-height:24px;padding-bottom:10px;}

.quiz_content li.cate_l dl dt{float:left;}

.quiz_content li.cate_l dl dd{float:left;padding-right:15px;}

.quiz_content li.cate_l dl dd label{cursor:pointer;}

.quiz_content .l_text{height:120px;position:relative;padding-left:18px;}

.quiz_content .l_text .m_flo{float:left;width:47px;}

.quiz_content .l_text .text{width:634px;height:109px;border:solid 1px #ccc;}

.quiz_content .l_text .tr{position:absolute;bottom:-18px;right:40px;}

/*goods-comm-stars style*/

.goods-comm{height:41px;position:relative;z-index:7;}

.goods-comm-stars{line-height:25px;padding-left:12px;height:41px;position:absolute;top:0px;left:0;width:400px;}

.goods-comm-stars .star_l{float:left;display:inline-block;margin-right:5px;display:inline;}

.goods-comm-stars .star_choose{float:left;display:inline-block;}

/* rater star */

.rater-star{position:relative;list-style:none;margin:0;padding:0;background-repeat:repeat-x;background-position:left top;float:left;}

.rater-star-item, .rater-star-item-current, .rater-star-item-hover{position:absolute;top:0;left:0;background-repeat:repeat-x;}

.rater-star-item{background-position: -100% -100%;}

.rater-star-item-hover{background-position:0 -48px;cursor:pointer;}

.rater-star-item-current{background-position:0 -48px;cursor:pointer;}

.rater-star-item-current.rater-star-happy{background-position:0 -25px;}

.rater-star-item-hover.rater-star-happy{background-position:0 -25px;}

.rater-star-item-current.rater-star-full{background-position:0 -72px;}

/* popinfo */

.popinfo{display:none;position:absolute;top:30px;background:url(images/infobox-bg.gif) no-repeat;padding-top:8px;width:192px;margin-left:-14px;}

.popinfo .info-box{border:1px solid #f00; border-top:0 none;padding:0 5px;color:#F60;background:#FFF;}

.popinfo .info-box div{color:#333;}

.rater-click-tips{font:12px/25px;color:#333;margin-left:10px;background:url(images/infobox-bg-l.gif) no-repeat 0 0;width:125px;height:34px;padding-left:16px;overflow:hidden;}

.rater-click-tips span{display:block;background:#FFF9DD url(images/infobox-bg-l-r.gif) no-repeat 100% 0;height:34px;line-height:34px;padding-right:5px;}

.rater-star-item-tips{background:url(images/star-tips.gif) no-repeat 0 0;height:41px;overflow:hidden;}

.cur.rater-star-item-tips{display:block;}

.rater-star-result{color:#FF6600;font-weight:bold;padding-left:10px;float:left;}

我要评论

满意度:
内 容: 字数限制为5-200个

一键复制

编辑

Web IDE

原始数据

按行查看

历史

html 评分星级显示,星级评分效果.html相关推荐

  1. [求助] 不显示删除回复显示所有回复显示星级回复显示得分回复 操作系统Swap分区2G,Weblogic却还偶尔报swap分区不够的异常,导致生产偶尔宕机...

    不显示删除回复显示所有回复显示星级回复显示得分回复 操作系统Swap分区2G,Weblogic却还偶尔报swap分区不够的异常,导致生产偶尔宕机# # An unexpected error has ...

  2. 什么是线索评分?如何让线索评分发挥作用?

    线索评分是一个有效的模型可帮助销售和营销部门确定哪些潜在客户对公司最具价值.但是线索评分系统只有在正确设置和使用的情况下才能发挥作用.否则就会浪费营销和销售的时间和资源. 什么是线索评分? 许多线索的 ...

  3. 金融风控-申请评分卡模型-申请评分卡介绍

    从这篇博文开始,我将总结金融风控中的另外一个模型:申请评分卡模型.这篇博文将主要来介绍申请评分卡的一些基本概念. 本篇博文将以以下四个主题来进行介绍说明: 信用风险和评分卡模型的基本概念 申请评分卡在 ...

  4. 信用评分模型开发(FICO评分)

    以支付宝的芝麻信用为例,其分值范围在350-950分.一般认为分值越高,信用越好,个人业务的违约率越低.这里用的也是与FICO评分类似的个人信用评分工具. FICO评分的只要思路是:多大量拥有多个属性 ...

  5. jQuery动画的显示与隐藏效果

    jQuery中用于控制元素显示和隐藏效果的方法如表1所示. 表1 控制元素的显示和隐藏 在表1中,参数speed表示动画的速度,可设置为动画时长的毫秒值(如1000),或预定的3种速度(slow.fa ...

  6. ML之回归预测:利用FSR/RiR/BasisExpand/ Lasso/DT/RF/GB算法对红酒品质wine数据集实现红酒口感评分预测(实数值评分预测)

    ML之回归预测:利用FSR/RiR/BasisExpand/ Lasso/DT/RF/GB算法对红酒品质wine数据集实现红酒口感评分预测(实数值评分预测) 目录 输出结果 设计思路 T1.FSR(前 ...

  7. ML之回归预测之Lasso:利用Lasso算法对红酒品质wine数据集实现红酒口感评分预测(实数值评分预测)

    ML之回归预测之Lasso:利用Lasso算法对红酒品质wine数据集实现红酒口感评分预测(实数值评分预测) 目录 输出结果 设计思路 核心代码 输出结果 设计思路 核心代码 t=3if t==1:X ...

  8. jQuery动画的显示与隐藏效果!

    jQuery中用于控制元素显示和隐藏效果的方法如表1所示. 表1 控制元素的显示和隐藏 在表1中,参数speed表示动画的速度,可设置为动画时长的毫秒值(如1000),或预定的3种速度(slow.fa ...

  9. H5在原生手机上显示选中文字效果

    H5在原生手机上显示选中文字效果 .comment {user-select: text;-webkit-user-select: text;-moz-user-select: text;-ms-us ...

最新文章

  1. js的apply()与call()的区别
  2. ubuntu16.04 耳机没声音解决办法
  3. C++加号运算符重载
  4. wxpython 安装教程
  5. ARP、Tracert、Route 与 NBTStat命令详解
  6. python大学什么专业学校_好学校的差专业和一般大学的好专业,该怎么选?我来说真话……...
  7. 淘宝双12惊喜——“寻”千兆,万兆光模块等你来
  8. Seq2Seq中的Attention
  9. jdk环境配置-windows 10
  10. 灵悟礼品网上专卖店——第三阶段Sprint
  11. 软件工程题库(荟萃)
  12. cmd 文本文件分割_cmd - 分割大文件
  13. 探索前沿脑科学,英特尔携手西悉尼大学共建“超级”计算机
  14. 关于Qt::WA_TransparentForMouseEvents的一些记录
  15. 计算存储和网络是推动云计算发展的三驾马车
  16. 在Android终端模拟器中操作adb调试命令
  17. 【报告分享】小红书平台2021 11.11期间行业投放分析报告-千瓜数据(附下载)
  18. 淘宝商品详情API接口(商品价格接口,商品属性接口)
  19. 1.面试题目汇总-嵌入式篇
  20. eNSP配置ospf——三台路由器

热门文章

  1. ESP32 入门笔记05: BLE 蓝牙客户端和服务器 (ESP32 for Arduino IDE)
  2. RabbitMQ学习笔记:惰性队列(Lazy Queues)
  3. 基于JAVA三坑购物平台演示录像2020计算机毕业设计源码+数据库+lw文档+系统+部署
  4. 腾讯“鹅城”开建,斥资370亿;提前泄露小米新机博主被判赔偿100万;传字节跳动实习生删除GB以下所有机器学习模型 | EA周报...
  5. 明年9月,南京大学苏州校区将正式招生!
  6. 曝光量的计算方式是什么?
  7. 分化成功的标志及特异性神经递质的检测
  8. 最强GTD Omnifocus3 (mac)
  9. 计算机无法检测到键盘,电脑无法识别键盘
  10. c 语言从指针得到对象,c – 获取指向由智能指针指向的对象的指针 – Ivalue错误...