推薦一款JQuery星形評級外掛程式

來源:互聯網
上載者:User

標籤:http   io   ar   os   sp   java   strong   on   div   

jRating 是一個非常靈活的jQuery外掛程式用於快速建立一個Ajax星型投票系統。可以設定星型數量和小數支援。功能很強大,具體大家可以看一下這個外掛程式的js代碼就知道了,下面這裡示範一下這個外掛程式有哪些功能與具體如何?。偃師市一中

Exemple 1 (Basic exemple without options) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".basic").jRating();  });</script>
Exemple 2 (type : small - average 10 - id 2 - 40 stars) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple2").jRating({  type:‘small‘, // type of the rate.. can be set to ‘small‘ or ‘big‘  length : 40, // nb of stars  decimalLength : 1 // number of decimal in the rate    });  });</script>
Exemple 3 (step : true - average 18 - id 2 - 15 stars) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple3").jRating({  step:true,  length : 20, // nb of stars  decimalLength:0 // number of decimal in the rate    });  });</script>
Exemple 4 (Rate is disabled) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple4").jRating({  isDisabled : true});  });</script>
Exemple 5 (With onSuccess & onError methods) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple5").jRating({  length:10,  decimalLength:1,  onSuccess : function(){    alert(‘Success : your rate has been saved :)‘);  },  onError : function(){    alert(‘Error : please retry‘);  }});  });</script>
Exemple 6 (jRating & jNotify plugins !!) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple6").jRating({  onSuccess : function(){    jSuccess(‘Success : your rate has been saved :)‘,{  HorizontalPosition:‘center‘,  VerticalPosition:‘top‘});  },  onError : function(){    jError(‘Error : please retry‘);  }});  });</script>
Exemple 7 (Rate infos disabled) : 
<!-- JS to add --><script type="text/javascript">  $(document).ready(function(){    $(".exemple7").jRating({  showRateInfo:false});  });</script>

推薦一款JQuery星形評級外掛程式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.