By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,636 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,636 IT Pros & Developers. It's quick & easy.

Two JS questions

P: n/a
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

Apr 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Apr 30 '06 #2

P: n/a
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

May 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.