Posted By

d0ri0 on 10/07/10


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tiikei
dekehooper


font resize


 / Published in: jQuery
 

  1. function font_size( plus_minus )
  2. {
  3.  
  4. $.each($('#content *').get(), function(index, value) {
  5. var curr_obj = $(value);
  6. var size = curr_obj.css("font-size");
  7. if( plus_minus == '+')
  8. var newSize = parseInt(size.replace(/px/, "")) + 1;
  9. else
  10. var newSize = parseInt(size.replace(/px/, "")) - 1;
  11. curr_obj.css("font-size", newSize + "px");
  12. });
  13.  
  14. return true;
  15. }
  16.  
  17. font_size( '+' );
  18. font_size( '-' );

Report this snippet  

You need to login to post a comment.