0

I have a problem with some users on my application. These users modify the text size (with display option in browsers) and after, they send a bug to say the application doesn't work because the text is to small.

Is it possible in javascript to have an event when a user modify these options ?

How can I catch it ?

chollida
  • 7,834
  • 11
  • 55
  • 85
Kiva
  • 9,193
  • 17
  • 62
  • 94
  • Have a look at / Possible duplicate of: http://stackoverflow.com/questions/1713771/how-to-detect-page-zoom-level-in-all-modern-browsers ;) – Johan May 28 '13 at 09:51
  • This question is about zoom (it's a problem too) but my question is more about the size text (even in zoom 100%). For exemple in IE, you can change it by menu "display" => "Text size" (approximate name from french ;) ) – Kiva May 28 '13 at 10:03

1 Answers1

1

This jQuery plugin seems to do exactly this:

https://github.com/johnantoni/jquery.onfontresize

The idea of this plugin is to have an iframe sized in em and a script in the iframe that is triggered on onresize. So if the user changes the size of the font in the window the iframe is resized and gets an resize event. This event can then be passed to the parent.

The problem is that the plugin was not updated for 3 years but i don't think it would be a big deal to bring it up to date.

In addition you need to check for the correct font size on document ready.

EDIT I check it with current jQuery version and IE. The plugin triggers the event if the font size is changeable via View > Text Size (when the pages font size is set with em or %) it the pages font size is set with px then the size of the font is not changing hence no event is triggered.

t.niese
  • 39,256
  • 9
  • 74
  • 101
  • This pluggin was not update since 3 years but I think I'll use this code to do what I want :) thanks. – Kiva May 28 '13 at 14:09
  • @Kiva Yes that's what i also was concerned about (And also mentioned in the answer ;) ) – t.niese May 28 '13 at 14:12