473,804 Members | 2,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Detect Width Change

When user enlarges font with Ctrl+[+] I want to increase the
dimensions of my fixed sized div. IE7 uses zoom-in, so it will
increase div dimensions automatically. Firefox, however, increases
font only, not div element.
I thought to implementing this by checking if my div width or height
changed and then resize it. But this approach did not work:

div.addEventLis tener('resize', someFunc, false);

Please advise. Thanks
Jan 14 '08 #1
4 8501
VK
On Jan 14, 11:20 pm, vunet <vunet...@gmail .comwrote:
When user enlarges font with Ctrl+[+] I want to increase the
dimensions of my fixed sized div. IE7 uses zoom-in, so it will
increase div dimensions automatically. Firefox, however, increases
font only, not div element.
I thought to implementing this by checking if my div width or height
changed and then resize it. But this approach did not work:

div.addEventLis tener('resize', someFunc, false);

Please advise. Thanks
Make your div size in em, not px, Firefox will handle that.
Jan 14 '08 #2
On Jan 14, 3:25 pm, VK <schools_r...@y ahoo.comwrote:
On Jan 14, 11:20 pm, vunet <vunet...@gmail .comwrote:
When user enlarges font with Ctrl+[+] I want to increase the
dimensions of my fixed sized div. IE7 uses zoom-in, so it will
increase div dimensions automatically. Firefox, however, increases
font only, not div element.
I thought to implementing this by checking if my div width or height
changed and then resize it. But this approach did not work:
div.addEventLis tener('resize', someFunc, false);
Please advise. Thanks

Make your div size in em, not px, Firefox will handle that.
how about other Mozilla-based browsers? or Safari?
Jan 14 '08 #3
vunet wrote:
On Jan 14, 3:25 pm, VK <schools_r...@y ahoo.comwrote:
>On Jan 14, 11:20 pm, vunet <vunet...@gmail .comwrote:
>>When user enlarges font with Ctrl+[+] I want to increase the
dimensions of my fixed sized div. IE7 uses zoom-in, so it will
increase div dimensions automatically. Firefox, however, increases
font only, not div element.
I thought to implementing this by checking if my div width or height
changed and then resize it. But this approach did not work:
div.addEventL istener('resize ', someFunc, false);
Please advise. Thanks
Make your div size in em, not px, Firefox will handle that.

how about other Mozilla-based browsers?
The correct term is Gecko-based, which also explains why there
will be little difference in rendering between them, if any.
or Safari?
General CSS questions and discussions are beyond the scope of this
newsgroup; comp.infosystem s.www.authoring.stylesheet exists. However, all
CSS-capable user agents would support the `em' unit of length, as that is
specified so.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jan 14 '08 #4
SAM
vunet a écrit :
When user enlarges font with Ctrl+[+] I want to increase the
dimensions of my fixed sized div. IE7 uses zoom-in, so it will
increase div dimensions automatically. Firefox, however, increases
font only, not div element.
I thought to implementing this by checking if my div width or height
changed and then resize it. But this approach did not work:

div.addEventLis tener('resize', someFunc, false);

Please advise. Thanks

arrange your div in proportional (en ou %)
all will work automatically

I don't think you can detect Control +
and then ... if you can ... how much will you have to grow ?
Since I can have my minimal fonts fixed on 16 or 18px

More ... on Mac it is Command +
What is the code to detect pressure on Command key ?


function detect(Event) {
if(Event==null) {
alert('null');
Event=event;
}
if (Event && Event.ctrlKey) {
if(Event.keyCod e=='107') alert('[Control] [+] pressed');
if(Event.keyCod e=='109') alert('[Control] [-] pressed');
}
}

<body onkeydown="dete ct(event)">

--
sm
Jan 15 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
14547
by: Michael Hill | last post by:
I have a perl script that i use to render a html page. In that page i call out a stylesheet. If the user has a 800x600 display the fonts are really too big. Since screen resolution is a function of the client and I have this javascript ot detect the srecc size: function ck_res() { if ( (screen.width != 1024) && (screen.height != 768) ) {
157
16463
by: Dennis | last post by:
Is there some way --using, say, DOM or javascript-- to detect the current pixel width and/or height of a relatively sized table or of one of its columns or rows. I'm going to be writing javascript to adjust my page to the viewer's browser window dimensions and this would sure be great information to have. Thanks .... Dennis
3
7139
by: Asterbing | last post by:
Since the "on fly addition..." thread has taken another direction, I'm opening a new one to be more explicit and recenter the subject. Well, the subject is to detect when a document is well loaded inside an iframe, knowing this document is CGI generated and that I can't modify the CGI itself (ie. add an onload event in the document body). All is said in the three HTML file I've copied below. Just create the three in same directory,...
3
5141
by: Randy Harris | last post by:
With a multiple column listbox, I'd like to be able to change the sort by allowing the user to click on a column. Is there a practical way detect in which column the user clicked? I know this could be done with a datasheet subform, but I was hoping to be able to use the listbox. Any suggestions? --
24
3041
by: dE|_ | last post by:
I have started looking into scripts for screen size detect with the intention of using them to pick from a number of CSS style sheets tailored to the size. Is there a good reason why this is not so commonly done? IE am I wasting my time? ---dE|_---
1
3248
by: azura | last post by:
how can i get this textfield auto detect?? because i try not to using view name button... i want when i enterd this matric no., the student name will appear automatically when i insert the matric no.. <table width="416" height="70" border="1"> <tr> <td width="87" height="33"><strong>Matric No</strong> </td> <td width="7"><div align="center">:</div></td> <td width="300"><input name="matric"...
0
9712
marktang
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...
0
10343
jinu1996
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...
1
10341
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,...
0
10089
tracyyun
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...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
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...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.