JQuery-based realment five-star praise

In the e-commerce website, we often use five-star score function. Now use jQuery to achieve a simple demo

      Pentagon rated case   * {Padding: 0; margin: 0;} .comment {font-size: 40px; color: teal;} .comment li {float: } ul {list-style: none;}   ☆   ☆ 
  • $ (Function () {var wjx_k = "☆"; var wjx_s = "★"; // prevall Gets the brothers node in front of the element NEXTALL Get all brothers // end methods behind the element; return to the previous layer // Siblings other brothers // Binding event $ ("li"). On ("mouseenter", function () {$ (this .html (wjx_s) .prevall (). HTML (wjx_s) .end (). nextall (). html (wjx_k);}). on ("click", function (){$ (this) .addclass ("Active"). Siblings (). RemoveClass ("Active")}); $ ("mouseeleave", function () {$ ("li"). HTML (WJX_K); $ (". Active"). TEXT (WJX_S) .prevall (). Text (wjx_s);})});
The above is all the content of this article, I hope to help everyone, I hope everyone will support Tumi Cloud.
© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment