样式代码:
<script type="text/javascript" src="[!--news.url--]e/data/js/ajax.js"></script> <style> .star-rating { list-style:none; margin: 0px; padding:0px; width: 150px; height: 30px; position: relative; background: url([!--news.url--]images/star_rating.gif) top left repeat-x; } .star-rating li { padding:0px; margin:0px; /*\*/ float: left;/* */ } .star-rating li a { display:block; width:30px; height: 30px; text-decoration: none; text-indent: -9000px; z-index: 20; position: absolute; padding: 0px; } .star-rating li a:hover { background: url([!--news.url--]images/star_rating.gif) left center; z-index: 2; left: 0px; } .star-rating a.one-star { left: 0px; } .star-rating a.one-star:hover { width:30px; } .star-rating a.two-stars { left:30px; } .star-rating a.two-stars:hover { width: 60px; } .star-rating a.three-stars { left: 60px; } .star-rating a.three-stars:hover { width: 90px; } .star-rating a.four-stars { left: 90px; } .star-rating a.four-stars:hover { width: 120px; } .star-rating a.five-stars { left: 120px; } .star-rating a.five-stars:hover { width: 150px; } .star-rating li.current-rating { background: url([!--news.url--]images/star_rating.gif) left bottom; position: absolute; height: 30px; width:90px; display: block; text-indent: -9000px; z-index: 1; } </style>
注意下载图片放到根目录images文件夹下,如:images/star_rating.gif,前面加网站地址标签[!--news.url--]images/star_rating.gif
调用代码:
<span id="showpf"> <script type="text/javascript" src="[!--news.url--]e/public/ViewClick?classid=[!--classid--]&id=[!--id--]&down=3"></script> </span>分 <ul class="star-rating"> <li class="current-rating"></li> <li><a href="JavaScript:makeRequest('[!--news.url--]e/enews/?enews=AddInfoPfen&classid=[!--classid--]&id=[!--id--]&doajax=1&ajaxarea=showpf&fen=1','EchoReturnedText','GET','');" class="one-star">1</a></li> <li><a href="JavaScript:makeRequest('[!--news.url--]e/enews/?enews=AddInfoPfen&classid=[!--classid--]&id=[!--id--]&doajax=1&ajaxarea=showpf&fen=2','EchoReturnedText','GET','');" class="two-stars">2</a></li> <li><a href="JavaScript:makeRequest('[!--news.url--]e/enews/?enews=AddInfoPfen&classid=[!--classid--]&id=[!--id--]&doajax=1&ajaxarea=showpf&fen=3','EchoReturnedText','GET','');" class="three-stars">3</a></li> <li><a href="JavaScript:makeRequest('[!--news.url--]e/enews/?enews=AddInfoPfen&classid=[!--classid--]&id=[!--id--]&doajax=1&ajaxarea=showpf&fen=4','EchoReturnedText','GET','');" class="four-stars">4</a></li> <li><a href="JavaScript:makeRequest('[!--news.url--]e/enews/?enews=AddInfoPfen&classid=[!--classid--]&id=[!--id--]&doajax=1&ajaxarea=showpf&fen=5','EchoReturnedText','GET','');" class="five-stars">5</a></li> </ul>
再次强调加网站地址标签 [!--news.url--] 效果图:
上传以下图片:
|