Closed GoogleCodeExporter closed 8 years ago
Sounds like the plugin is being loaded before you've changed the configuration.
Check the order in which your script is being executed.
OR, you can also use the "disabled" attribute as the examples demonstrate on
the
plugin website:
http://www.fyneworks.com/jquery/star-rating/
Original comment by diego.a...@gmail.com
on 26 Mar 2009 at 12:40
Yes, I want change my script order, but I don't know how.
When I add new defaults into jquery ready function it doesn't work. And If I id
outside ready function form may not be ready for reading. I'm interested on how
to
put my script before stars script initialize itself.
Setting disabled helps, and I don't want waste your time. If you know what I
mean I'm
interested in solution, if not never mind. Thank for help
Petr
Original comment by petr.sno...@gmail.com
on 26 Mar 2009 at 1:08
You should do it in this order:
1. include jquery
2. include plugin
3. $.extend($.fn.rating, { options: { required: true } });
4. Add star class to input element
5. jQuery will automatically initialize plugin here
Original comment by diego.a...@gmail.com
on 1 Apr 2009 at 11:22
And what if I need call $.extend based on another element? I should check
element
value in $(function(). and it looks like step 5 is passed.
something like this dosn't work
$(function() {
if ($('#rating_form').hasClass('readonly')) {
$.extend($.fn.rating, { options: { readOnly: true } });
}
});
Original comment by petr.sno...@gmail.com
on 1 Apr 2009 at 12:20
No.
Just use another class and initialize the plugin yourself with your own
options, like
this:
$('.readonly-stars').rating({
readOnly: true
});
Original comment by diego.a...@gmail.com
on 1 Apr 2009 at 1:26
Thank you for your time, disabled attribute works perfect in my scenario. I
only want
know if I'm not doing something wrong.
Thank you again
Petr
Original comment by petr.sno...@gmail.com
on 1 Apr 2009 at 5:24
Original issue reported on code.google.com by
petr.sno...@gmail.com
on 26 Mar 2009 at 7:20