最新下载
24小时阅读排行榜
- 1 C#如何反序列化XML到对象列表
- 2 如何通过 URL 参数自动触发 AJAX 搜索并预填充搜索框
- 3 SQL Group By 多字段并聚合求和:PHP+MySQL 实战教程
- 4 SBOM (软件物料清单) 是什么 如何上传和解析CycloneDX/SPDX格式的XML
- 5 怎么用XSLT生成文本文件 output method=text
- 6 如何在 PHPMailer 邮件模板中正确执行 PHP 代码而非显示源码
- 7 如何让侧边栏中的 Font Awesome 图标在不同列表项中垂直对齐
- 8 c++中如何获取系统当前时间_c++获取当前时间戳的方法【实例】
- 9 php实时输出后台任务实时显_php实时输出后台反馈【教程】
- 10 php获取本机ip返回多个值咋处理_php筛选有效ip法【技巧】
- 11 C++中的std::bind怎么使用?(参数绑定与函数对象适配)
- 12 php修改权限用glob找文件再改_php批量匹配改权限法【步骤】
- 13 Go App Engine 构建约束与 appengine 包导入详解
- 14 如何在 Go 中通过指针修改映射(map)中结构体对象的字段值
- 15 css 想让网格容器子元素宽高比固定怎么办_aspect-ratio 配合 grid-template-rows
最新教程
-
- Node.js 教程
- 16120 2025-08-28
-
- CSS3 教程
- 1546547 2025-08-27
-
- Rust 教程
- 23251 2025-08-27
-
- Vue 教程
- 25723 2025-08-22
-
- PostgreSQL 教程
- 22207 2025-08-21
-
- Git 教程
- 9192 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)+'分'))
})
