最新下载
jQuery分屏显示图片跟描述
24小时阅读排行榜
- 1 C# WebClient下载文件方法 C#如何使用WebClient下载文件
- 2 mysql如何备份SSL加密环境下的数据_mysql安全证书在备份中应用
- 3 C++ short数组重置为0方法 C++ short int清空【技巧】
- 4 C#实现简单的文件数据库 C#如何用JSON或二进制文件模拟键值存储
- 5 CSS框架如何在原生无JS环境中提供下拉菜单或标签页
- 6 如何在Golang中实现HTTP请求中间件 Go语言拦截器与日志记录实战
- 7 Navicat配置同步前执行预处理脚本的详细步骤是什么_图文指南
- 8 Python怎么计算移动平均_rolling()窗口函数应用与平滑曲线
- 9 Redis怎样自定义Spring Cache的缓存过期时间
- 10 mysql如何排查特定Session持有的锁资源_mysql performance_schema锁追踪
- 11 如何通过phpMyAdmin实现多层级管理架构_高级用户的授权配置
- 12 mysql中正则表达式与REGEXP运算符的基本语法
- 13 php如何查看数据库版本_获取mysql版本的sql语句【说明】
- 14 CSS如何通过vw单位实现纯移动端页面的等比缩放
- 15 如何安全地在数据库中存储含链接的富文本(HTML 片段)
最新教程
-
- Node.js 教程
- 18416 2025-08-28
-
- CSS3 教程
- 1553790 2025-08-27
-
- Rust 教程
- 25558 2025-08-27
-
- Vue 教程
- 27216 2025-08-22
-
- PostgreSQL 教程
- 23588 2025-08-21
-
- Git 教程
- 10460 2025-08-21
代码片段:
$(function () {
//评分
var starRating = 0;
$('.photo span').on('mouseenter',function () {
var index = $(this).index()+1;
$(this).prevAll().find('.high').css('z-index',1)
$(this).find('.high').css('z-index',1)
$(this).nextAll().find('.high').css('z-index',0)
$('.starNum').html((index*2).toFixed(1)+'分')
})
$('.photo').on('mouseleave',function () {
$(this).find('.high').css('z-index',0)
var count = starRating / 2
if(count == 5) {
$('.photo span').find('.high').css('z-index',1);
} else {
$('.photo span').eq(count).prevAll().find('.high').css('z-index',1);
}
$('.starNum').html(starRating.toFixed(1)+'分')
})
$('.photo span').on('click',function () {
var index = $(this).index()+1;
$(this).prevAll().find('.high').css('z-index',1)
$(this).find('.high').css('z-index',1)
starRating = index*2;
$('.starNum').html(starRating.toFixed(1)+'分');
alert('评分:'+(starRating.toFixed(1)+'分'))
})
