100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > jQuery动态星级评分效果实现方法【jquery】

jQuery动态星级评分效果实现方法【jquery】

时间:2022-05-27 15:14:39

相关推荐

jQuery动态星级评分效果实现方法【jquery】

web前端|js教程

jQuery,动态,星级评分

web前端-js教程

本文实例讲述了jQuery动态星级评分效果实现方法。分享给大家供大家参考。具体如下:

oc 源码,史上最全Ubuntu安装,tomcat回显数据乱码,pycharm安装爬虫,php开发外派怎么收费,工具seolzw

这里的jQuery星级评分代码,是大家都很喜欢的功能,目前广泛应用,本星级评分加入了动画效果,注意,如果要真正实现星级评分,你需要动态程序配合,如ASP/PHP等,以便将评分值存入数据库。

合买代购源码,ubuntu集群文件同步,tomcat总是跑空项目,爬虫 图片 编码,php换行替换,余杭区seo优化关键词lzw

运行效果下图例:

盛世源码解压密码,vscode配置文件模板,ubuntu 大屏,tomcat的服务名称,爬虫生活图片,php连接mysql慢,seo推广平台找哪家,海纳企业网站后台管理路径,dede导航模板制作lzw

具体代码如下:

jquery超漂亮星级评分.user_rate {font-size:14px; position:relative; padding:10px 0;}.user_rate p {margin:0; padding:0; display:inline; height:40px; overflow:hidden; position:absolute; top:0; left:100px; margin-left:140px;}.user_rate p span.s {font-size:36px; line-height:36px; float:left; font-weight:bold; color:#DD5400;}.user_rate p span.g {font-size:22px; display:block; float:left; color:#DD5400;}.big_rate_bak {width:140px; height:28px; text-align:left; position:absolute; top:3px; left:85px; display:inline-block; background:url(/file_images/article/08/86174000242.jpg) left bottom repeat-x;}.big_rate_bak b {display:inline-block; width:24px; height:28px; position:relative; z-index:1000; cursor:pointer; overflow:hidden;}.big_rate_up {width:140px; height:28px; position:absolute; top:0; left:0; background:url(/file_images/article/08/86174000242.jpg) left top;}

如果运行错误请刷新页面即可~$(function(){ get_rate(88);})function get_rate(rate){ rate=rate.toString(); var s; var g; $("#g").show(); if (rate.length>=3){ s=10;g=0; $("#g").hide(); }else if(rate=="0"){ s=0; g=0; }else{ s=rate.substr(0,1); g=rate.substr(1,1); } $("#s").text(s); $("#g").text("."+ g); $(".big_rate_up").animate({width:(parseInt(s)+parseInt(g)/10) * 14,height:26},1000); $(".big_rate_bak b").each(function(){ $(this).mouseover(function(){$(".big_rate_up").width($(this).attr("rate") * 14 );$("#s").text($(this).attr("rate"));$("#g").text(""); }).click(function(){$("#f").text($(this).attr("rate"));$("#my_rate").show(); }) }) $(".big_rate_bak").mouseout(function(){ $("#s").text(s); $("#g").text("."+ g); $(".big_rate_up").width((parseInt(s)+parseInt(g)/10) * 14); })}function up_rate(rate){ $(".big_rate_up").width("0"); get_rate(rate);}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。