Skip to content

Instantly share code, notes, and snippets.

@timsnadden
Created August 6, 2010 01:43
Show Gist options
  • Save timsnadden/510697 to your computer and use it in GitHub Desktop.
Save timsnadden/510697 to your computer and use it in GitHub Desktop.
$.fn.detectTextResize = function() {
return this.each(function() {
var el = $(this);
var initialSize = el.css('font-size');
setInterval(function(){
var currentSize = el.css('font-size');
if(currentSize != initialSize){
initialSize = currentSize;
el.trigger('textResized');
}
}, 500);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment