本文实例讲述了Javascript模仿淘宝信用评价实现方法。分享给大家供大家参考,具体如下:
老板昨天开会说:要给公司的购物平台增加信用评价功能,用户体验参考淘宝。
于是今天研究了一下,用jQuery模似一个类似的效果:
代码如下:
模仿淘宝的信用评价 * { padding: 0; margin: 0; list-style: none; font-size: 12px; } #starBox { margin: 100px; } #starInit { width: 120px; height: 36px; overflow: hidden; float: left; } #star_wrap, #ulStars { width: 120px; height: 18px; overflow: hidden; float: left; } #ulStars li { width: 19px; height: 18px; background: url(bg.gif) no-repeat -278px -96px; float: left; margin-right: 5px; cursor: pointer; } #ulStars li.good { background: url(bg.gif) no-repeat -278px -52px; } #ulStars li.bad { background: url(bg.gif) no-repeat -278px -73px; } #tip { width: 171px; height: 67px; background: url(bg.gif) no-repeat -40px -167px; padding: 15px 3px 0 5px; line-height: 18px; } #txtStar { position: absolute; left: 0; top: -30px; } #rate_1_result { float: left; line-height: 25px; text-indent: 15px; color: Red; } ←点击星星就能评价了
完整实例代码代码点击此处本站下载。
希望本文所述对大家Javascript程序设计有所帮助。



