In Javascript, how do I detect that the user has used the browser's menu
command to make the font smaller?
I just need some kind of event or callback, so I can adapt to the new
environment.
--
David Phillip Oster 3 1345
In article <os************ *************@n ewssvr13-ext.news.prodig y.com>, os***@ieee.org enlightened us with... In Javascript, how do I detect that the user has used the browser's menu command to make the font smaller?
I don't think you can tell that.
Especially since a user can resize text by using the mouse, too. Mine is set
up to resize when I use control + middle mouse scroll.
--
--
~kaeli~
The best part of having kids is giving them back to their
parents. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
"kaeli" wrote os***@ieee.org enlightened us with... In Javascript, how do I detect that the user has used the browser's menu command to make the font smaller?
I don't think you can tell that.
Especially since a user can resize text by using the mouse, too. Mine is set up to resize when I use control + middle mouse scroll.
All the known events do not cover this, which is a shame indeed, so you need
to constantly monitor the dimensions of a test element. A quick and dirty
example uses the setTimeout() method for that:
<script type="text/javascript">
var old, tid;
function checksize() {
var cur = document.getEle mentById('test' ).offsetWidth;
if( old && old !== cur ) {
alert( 'You just zoomed ' + ( old < cur ? 'in' : 'out' ) + '!' );
}
old = cur;
tid = setTimeout( ' checksize(); ', 50 );
}
window.onload = checksize;
</script>
</head><body>
<div id="test" style="position :absolute;left:-100px;">WWW</div>
In a quick test I learned if the page is in a frameset, IE does not update
offsetWidth's etc. until the window is resized, sigh.
hth
--
Ivo
In article <42************ ***********@new s.wanadoo.nl>,
"Ivo" <no@thank.you > wrote: All the known events do not cover this, which is a shame indeed, so you need to constantly monitor the dimensions of a test element. A quick and dirty example uses the setTimeout() method for that:
<script type="text/javascript">
var old, tid;
function checksize() { var cur = document.getEle mentById('test' ).offsetWidth; if( old && old !== cur ) { alert( 'You just zoomed ' + ( old < cur ? 'in' : 'out' ) + '!' ); } old = cur; tid = setTimeout( ' checksize(); ', 50 ); }
window.onload = checksize;
</script> </head><body> <div id="test" style="position :absolute;left:-100px;">WWW</div>
In a quick test I learned if the page is in a frameset, IE does not update offsetWidth's etc. until the window is resized, sigh.
Thank you. Not great, but it will do.
David Phillip Oster
--
David Phillip Oster This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Andreas Prilop |
last post by:
Internet Explorer displays <tt>, <code> etc. in a smaller font size:
http://www.unics.uni-hannover.de/nhtcapri/temp/monospace.html
I don't like the idea that monospaced text is displayed in a different
size. Should we state "font-size: 100%" with monospaced text?
--
Meanwhile at the Google Ranch ...
"I can't read this bloody site; it's all Falsh and JavaScrap."
"Forget it and move on! Still 2 718 281 828 pages to crawl."
|
by: Matt Adams |
last post by:
I want define for a couple of words inside a longer text with different font specifications.
I declared it like:
....text before....
<FONT class=aaa> these text should get other attributes </FONT>
text after
However when I let this html source validate the FONT tag is marked as not compatible with XHTML.
So how do I specify otherwise new font attributes to only a few words?
|
by: David Trimboli |
last post by:
If you look at http://www.trimboli.name/klingon/, you'll see that the
headers on the page are displayed in small-caps. Usually, this is
desired. However, the header "may'vaD ghuHmoH QoQ"* is surrounded by
<span lang="tlh"> ("tlh" for "tlhIngan Hol"), and I have put a
declaration of "font-variant: normal" in the main stylesheet. I can't
figure out why the Klingon title is still in small-caps. I want all
Klingon phrases to appear in normal...
|
by: Chad Sanford |
last post by:
I have some server side code that instantiates a font object that is then
used for generating a chart.
It has worked great on many machines, but I have run into one where it is
throwing a System.ArgumentException. From the documentation, that would
seem to indicate the font is not present, but since I am using generic sans
serif I have my doubts about that.
The offending line of code is:
|
by: Achim Domma (SyynX Solutions GmbH) |
last post by:
Hi,
is there a possibility to set the font size to a percent value of the
"top level" font size?
For example:
The font size of the body might be 100% and I have a div which should
have a font size of 80% of this value, independent of other tags around
this div:
| |
by: Altemir |
last post by:
I have a datagrid in an .aspx page that contains some columns using the
"Font=Bold" inline style. The problem is that some users' browsers
aren't displaying the bold font while others are.
We all seem to be using Internet Explorer 6.0. Is the "Font-Bold"
style dependent on some sort of browser setting? If so, where do I
find this setting?
|
by: Iacopo.Marmo |
last post by:
Hi! I need to manipulate multicolor strings, i.e. strings with a color
associated with each letter.
Any suggestions?
|
by: MadingS |
last post by:
Is there an HTML (or CSS) way to say "use the user's INPUT font,
whatever that might be."?
Most browsers have the ability for the user to pick his or her own
preference for what font to use inside of <INPUTtags. My question
is, is there a way in HTML or StyleSheet language to say something like
this:
<h4>Here are some values - some are hardcoded, and others are input
feilds:</h4>
<FONT face="same as user's input font preference"...
|
by: david.karr |
last post by:
I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}
I understand everything but the "/1.231". Is that something like a
multiplier on the EM size? I can't find an example of that in the CSS
spec.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |