Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter celik75

    (@celik75)

    missing some attr:

    width: 40px; //depends on average rating
    background-position: 0 0;

    Thread Starter celik75

    (@celik75)

    I fixed the issue!
    My loop is loading from ajax so:

    wrapping
    $(document).ajaxComplete(function() {}

    on jQuery( “.wpcr_averageStars” ).each(function() {…}

    new js code into my theme:

    $(document).ajaxComplete(function() {
            $( ".wpcr_averageStars" ).each(function() {
                //Get the value
                        var val1 = $(".wpcr_averageStars").attr("id");
                        //alert(val1);
                        // Make sure that the value is in 0 - 5 range, multiply to get width
                        var size1 = Math.max(0, (Math.min(5, val1))) * 16;
                        // Create stars holder
                        var $span1 = jQuery('<span />').width(size1);
                        // Replace the numerical value with stars
                        $(".wpcr_averageStars").html($span1);
            });
        });
    • This reply was modified 5 years, 4 months ago by celik75.
    Plugin Author shoaib88

    (@shoaib88)

    Hi,
    I’m glad you fixed this issue.
    Thanks

    top! exactly what i need right now, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘All stars black on average page’ is closed to new replies.