4.4.js 336 B

123456789101112
  1. $(document).ready(function() {
  2. var $speech = $('div.speech');
  3. $('#switcher button').click(function() {
  4. var num = parseFloat($speech.css('fontSize'));
  5. if (this.id == 'switcher-large') {
  6. num *= 1.4;
  7. } else if (this.id == 'switcher-small') {
  8. num /= 1.4;
  9. }
  10. $speech.css('fontSize', num + 'px');
  11. });
  12. });