最新下载
24小时阅读排行榜
- 1 html源码怎么保存为云端网页文件_html源码保存到云端的详细步骤
- 2 js some方法是什么
- 3 Linux visudo命令安全编辑示例
- 4 mysql InnoDB和MyISAM的对比
- 5 .NET Core Web API如何处理跨域(CORS)问题_CORS跨域解决方案
- 6 mysql如何查看数据库名
- 7 win11键盘失灵了怎么办 Win11键盘部分或全部按键无反应修复指南
- 8 CSS布局中grid-auto-flow属性如何使用_自动排列网格技巧
- 9 显卡散热模组横评:三风扇 vs. 双风扇 vs. 涡轮卡的温度与噪音
- 10 HTML5代码如何管理会话存储 HTML5代码中sessionStorage的应用
- 11 python列表排序的两种方式
- 12 win11如何开启卓越性能模式_Windows11性能模式调整方法
- 13 b站名片怎么关_关闭或隐藏B站个人名片的操作方式
- 14 在Java中如何使用接口实现抽象
- 15 LEANTS乐蚁J5怎样设置指纹解锁_LEANTS乐蚁J5指纹解锁功能开启与使用方法
最新教程
-
- Node.js 教程
- 7669 2025-08-28
-
- CSS3 教程
- 1069510 2025-08-27
-
- Rust 教程
- 12138 2025-08-27
-
- Vue 教程
- 14325 2025-08-22
-
- PostgreSQL 教程
- 11063 2025-08-21
-
- Git 教程
- 5224 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)+'分'))
})

