diff --git a/js/jquery.onfontresize.js b/js/jquery.onfontresize.js new file mode 100644 index 00000000..a835c1cd --- /dev/null +++ b/js/jquery.onfontresize.js @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2008 Tom Deater (http://www.tomdeater.com) + * Licensed under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * uses an iframe, sized in ems, to detect font size changes then trigger a "fontresize" event + * heavily based on code by Hedger Wang: http://www.hedgerwow.com/360/dhtml/js-onfontresize.html + * + * "fontresize" event is triggered on the document object + * subscribe to event using: $(document).bind("fontresize", function (event, data) {}); + * "data" contains the current size of 1 em unit (in pixels) + * + */ + +jQuery.onFontResize = (function ($) { + // initialize + $(document).ready(function () { + var $resizeframe = $("