非常酷的点亮星星评分特效

2个月前 (03-06 18:56)阅读37回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4189
  • 级别管理员
  • 主题837
  • 回复2
楼主

网页上最常用的评分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-type" content="text/html;charset=gb2312">
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>非常酷的点亮星星评分特效_武鸣人</title>
<style type="text/css">
.www_wuming_ren{font-size:14px;position:relative;padding:10px 0;}
.www_wuming_ren p{margin:0;padding:0;display:inline;height:40px;overflow:hidden;position:absolute;top:0;left:0px;margin-left:145px;}
.www_wuming_ren p span.s{font-size:36px;line-height:36px;float:left;font-weight:bold;color:#DD5400;}
.www_wuming_ren p span.g{font-size:22px;display:block;float:left;color:#DD5400;}
.big_rate_bak{width:140px;height:28px;overflow:hidden;text-align:left;position:absolute;top:0px;left:0px;display:inline-block;background:url(/img/20240306_www_wuming_ren_31.gif) left -32px repeat-x;}
.big_rate_bak b{display:inline-block;width:28px;float:left;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(/img/20240306_www_wuming_ren_31.gif) left top;}
</style>
<script type="text/javascript" src="/img/jquery_wuming_ren.js"></script>
</head>
<body>
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
需要加载js文件,请刷新页面后看效果
<div class="www_wuming_ren">
    <div class="big_rate_bak">
        <b rate="2" onclick="javascript:up_wuming_ren(20);"> </b>
        <b rate="4" onclick="javascript:up_wuming_ren(40);"> </b>
        <b rate="6" onclick="javascript:up_wuming_ren(60);"> </b>
        <b rate="8" onclick="javascript:up_wuming_ren(80);"> </b>
        <b rate="10" onclick="javascript:up_wuming_ren(100);"> </b>
        <div style="width:45px;" class="big_rate_up"></div>
    </div>
    <p><span id="s" class="s"></span><span id="g" class="g"></span></p>
</div>
<script type="text/javascript">
$(function(){
get_rate(88);
})//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
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);
})
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function up_wuming_ren(rate){
$(".big_rate_up").width("0");
get_rate(rate);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
</body>
</html>


0
0
收藏0
回帖

非常酷的点亮星星评分特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息