Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. var min=8;
  2. var max=18;
  3. function increaseFontSize() {
  4. var p = document.getElementsByTagName('p');
  5. for(i=0;i<p.length;i++) {
  6.  
  7. if(p[i].style.fontSize) {
  8. var s = parseInt(p[i].style.fontSize.replace("px",""));
  9. } else {
  10. var s = 12;
  11. }
  12.  
  13. if(s!=max) {
  14. s += 1;
  15. }
  16.  
  17. p[i].style.fontSize = s+"px"
  18. }
  19.  
  20. }
  21.  
  22. function decreaseFontSize() {
  23. var p = document.getElementsByTagName('p');
  24. for(i=0;i<p.length;i++) {
  25.  
  26. if(p[i].style.fontSize) {
  27. var s = parseInt(p[i].style.fontSize.replace("px",""));
  28. } else {
  29. var s = 12;
  30. }
  31.  
  32. if(s!=min) {
  33. s -= 1;
  34. }
  35.  
  36. p[i].style.fontSize = s+"px"
  37. }
  38.  
  39. }
  40.  
  41. function increaseFontSize() {
  42. var li = document.getElementsByTagName('li');
  43. for(i=0;i<li.length;i++) {
  44.  
  45. if(li[i].style.fontSize) {
  46. var s = parseInt(li[i].style.fontSize.replace("px",""));
  47. } else {
  48. var s = 12;
  49. }
  50.  
  51. if(s!=max) {
  52. s += 1;
  53. }
  54.  
  55. li[i].style.fontSize = s+"px"
  56. }
  57.  
  58. }
  59.  
  60. function decreaseFontSize() {
  61. var li = document.getElementsByTagName('li');
  62. for(i=0;i<li.length;i++) {
  63.  
  64. if(li[i].style.fontSize) {
  65. var s = parseInt(li[i].style.fontSize.replace("px",""));
  66. } else {
  67. var s = 12;
  68. }
  69.  
  70. if(s!=min) {
  71. s -= 1;
  72. }
  73.  
  74. li[i].style.fontSize = s+"px"
  75. }
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement