最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery rateYo plugin that continue rating after rated star click? - Stack Overflow

programmeradmin2浏览0评论

I tried but I did not resolve problem about perfect jquery plugin named rateYo.

I prepared a sample on this page:

/

$(".rateYo").rateYo({
  onSet: function(rating, rateYoInstance) {
    $(this).next().val(rating);
  },
  rating: 0,
  starWidth: "20px",
  numStars: 5,
  fullStar: true
});
<script src=".1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.css" />
<script src="/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.js"></script>
<div class="rateYo" id="a1"></div>
<input type="text" id="t1">
<div class="rateYo" id="a2"></div>
<input type="text" id="t2">
<div class="rateYo" id="a3"></div>
<input type="text" id="t3">

I tried but I did not resolve problem about perfect jquery plugin named rateYo.

I prepared a sample on this page:

http://jsfiddle/a1oewfwn/

$(".rateYo").rateYo({
  onSet: function(rating, rateYoInstance) {
    $(this).next().val(rating);
  },
  rating: 0,
  starWidth: "20px",
  numStars: 5,
  fullStar: true
});
<script src="https://ajax.googleapis./ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://rateyo.fundoocode.ninja/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.css" />
<script src="http://rateyo.fundoocode.ninja/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.js"></script>
<div class="rateYo" id="a1"></div>
<input type="text" id="t1">
<div class="rateYo" id="a2"></div>
<input type="text" id="t2">
<div class="rateYo" id="a3"></div>
<input type="text" id="t3">

If you click on any star, let's say you click on 3rd star in row 2, it fixes all three rows to 3rd star while you move your mouse over from the first to fifth.

I want achieve, that all three rows are fixed to the last selection.

How can I solve this?

Share Improve this question edited Mar 10, 2017 at 13:07 Gh61 9,7755 gold badges29 silver badges41 bronze badges asked May 21, 2015 at 21:53 Nuri AkmanNuri Akman 8203 gold badges19 silver badges41 bronze badges 1
  • 1 This is a bug, i shall try to fix this by next release - Thanks for pointing it out. – Prashanth Pamidi Commented May 29, 2015 at 12:09
Add a ment  | 

2 Answers 2

Reset to default 3

Setting the plugin individually seems to work

$(".rateYo").each(function (e) {
    $(this).rateYo({
        onSet: function (rating, rateYoInstance) {
            $(this).next().val(rating);
        },
        rating: 0,
        starWidth: "20px",
        numStars: 5,
        fullStar: true
    });
});

$(".rateYo").each(function(e) {
      $(this).rateYo({
        onSet: function(rating, rateYoInstance) {
          $(this).next().val(rating);
        },
        rating: 0,
        starWidth: "20px",
        numStars: 5,
        fullStar: true
      });
    });
<script src="https://ajax.googleapis./ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://rateyo.fundoocode.ninja/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.css" />
<script src="http://rateyo.fundoocode.ninja/bower_ponents/jquery-rateyo/min/jquery.rateyo.min.js"></script>
<div class="rateYo" id="a1"></div>
<input type="text" id="t1">
<div class="rateYo" id="a2"></div>
<input type="text" id="t2">
<div class="rateYo" id="a3"></div>
<input type="text" id="t3">

Use the attribute. readOnly: true

发布评论

评论列表(0)

  1. 暂无评论