Advertisement
b0rn-to-be-wild

FONT WIDGET SCRIPT

Nov 24th, 2018
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <!----- FONT WIDGET BY @BORNTOBEWILDCODES ----->
  2.  
  3. <script>
  4. $(document).ready(function () {
  5.  
  6. $('#font-box-bttn').on('click',function () {
  7. $('#font-box').fadeToggle();
  8. });
  9.  
  10. /* You need to insert div ids and classes of all heading elements inside the line: #font-box-bttn, h1, h2, .title, #blogtitle, .quote and separate them by commas. Optionally, remove those that your theme doesn't include. */
  11.  
  12. $('#accent-fontfamily').on('change', function() {
  13. $('#font-box-bttn, h1, h2, .title, #blogtitle, .quote').css("font-family", this.value);
  14. });
  15.  
  16. $('#accent-fontsize').on("input", function() {
  17. var dInput = this.value;
  18. console.log(dInput);
  19. $('#font-box-bttn, h1, h2, .title, #blogtitle, .quote').css("font-size", dInput);
  20. });
  21.  
  22. $('#accent-fontcolor').on("input", function() {
  23. var dInput = this.value;
  24. console.log(dInput);
  25. $('h1, h2, .title, #blogtitle, .quote').css("color", dInput);
  26. });
  27.  
  28. /* You need to insert div ids and classes of all body elements inside the line: body, #container, #posts, .entry, #sidebar, #header, #footer and separate them by commas. Optionally, remove those that your theme doesn't include. */
  29.  
  30. $('#body-fontfamily').on('change', function() {
  31. $('body, #container, #posts, .entry, #sidebar, #header, #footer').css("font-family", this.value);
  32. });
  33.  
  34. $('#body-fontsize').on("input", function() {
  35. var dInput = this.value;
  36. console.log(dInput);
  37. $('body, #container, #posts, .entry, #sidebar, #header, #footer').css("font-size", dInput);
  38. });
  39.  
  40. $('#body-fontcolor').on("input", function() {
  41. var dInput = this.value;
  42. console.log(dInput);
  43. $('body, #container, #posts, .entry, #sidebar, #header, #footer').css("color", dInput);
  44. });
  45.  
  46. });
  47. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement