1、引入jquery.js文件
2、引入jquery.raty.js
3、頁面中放在這個(gè):<span class="readOnly" data-path="images" ><i>4.5</i></span>
4、js:
function star(obj,num){ $(obj).raty({ path: function() { return this.getAttribute('data-path');//路徑 }, readOnly: true, score: num //(starr)這個(gè)4.5就是星星右邊的數(shù)值 });};var ac = $('.starr').find('i').text();star('.readOnly',ac);以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持武林網(wǎng)!
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注