Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Two JS questions

24 views
Skip to first unread message

onetitfemme

unread,
Apr 30, 2006, 9:50:34 AM4/30/06
to
What is the window event fired by the browser when you increase or
decrease the text size and when you change the font on a page? How
cross browser are these actions?

Why is it that sometimes you must use inline styles? (I have tried
doing it in may different ways)

otf js

Matt Kruse

unread,
Apr 30, 2006, 10:07:31 AM4/30/06
to
onetitfemme wrote:
> What is the window event fired by the browser when you increase or
> decrease the text size and when you change the font on a page? How
> cross browser are these actions?

I've never seen an event which is fired with this action. If it exists, it's
most likely IE-only.

> Why is it that sometimes you must use inline styles? (I have tried
> doing it in may different ways)

Do a google search on "css specficity", but that's outside the scope of this
group.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


Csaba Gabor

unread,
May 1, 2006, 11:41:13 AM5/1/06
to
Matt Kruse wrote:
> onetitfemme wrote:
> > What is the window event fired by the browser when you increase or
> > decrease the text size and when you change the font on a page? How
> > cross browser are these actions?
>
> I've never seen an event which is fired with this action. If it exists, it's
> most likely IE-only.

I haven't investigated in detail, but it seems like the following will
detect font size change in Firefox, but not in IE:

<html><head><title>onResize testing for FF/IE</title></head>
<body style="border:1px solid red"><span
style="border:1px solid blue">
Change the font or window size to see
whether onresize event listeners fire
</span>
<script type='text/javascript'>
var oElem = {window:1, document:1, "document.body":1,
"document.body.firstChild":1 }
var oListeners = {resize:1, DOMAttrModified:1}
var idxE, idxL
for (var idxE in oElem)
for (var idxL in oListeners)
addListener (eval(idxE), idxL,
function(idxE, idxL) { return (
function() {
alert(idxE + " " + idxL + " has fired");}) }(idxE, idxL));
function addListener (ctl, evtName, evtHandler) {
if (document.all) ctl['on'+evtName] = evtHandler;
else ctl.addEventListener(evtName,
function(e){evtHandler(e);}, false); }
</script>
</body></html>

Csaba Gabor from Vienna

0 new messages