473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ie css min-width max-width

yb
Hello,

I've been trying to emulate css min-width and max-width in IE.

I've looked at various methods on the web, but none seemed to truly
emulate min-width / max-width, or at least not very elegantly.

There are two problems I've noticed:
1) padding / margin around containing element throw off calculations in
IE, even in strict mode. But there should be work arounds using an
extra containing element, so this isn't too bad I guess.

2) Using min-width / max-width with anything other than pixel based
values is problematic, unless there is some way to convert the units in
to pixels.

The code below finds the min-width and max-width in IE as they are in
the styleSheet using propriatery microsoft "currentStyle" property.
This does not give the value set with "style" property which is for
inline styles only, it is the true stylesheet value.

var e = document.getElementById( id );
var minWidth = e.currentStyle["min-width"];
var maxWidth = e.currentStyle["max-width"];

The pixel length of the item e, (the container we want to limit size
of) is:

var width = e.clientWidth;

With these values, we could then compare and limit the size of the
element in the script. It would be really nice if 'minWidth' and
'maxWidth' values could be converted into pixels. For example, if they
were specified in EM units. This is obviously calculated internally in
IE, is there some way to expose it in the script? Also, I only have
IE6 to test with, I'm assuming IE5 has the same methods.

Oct 14 '05 #1
1 4010
"yb" <ba*********@yahoo.ca> wrote:
I've been trying to emulate css min-width and max-width in IE.

I've looked at various methods on the web, but none seemed to truly
emulate min-width / max-width, or at least not very elegantly.


Are you aware of http://dean.edwards.name/IE7/ ?

--
Spartanicus
Oct 15 '05 #2

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

Similar topics

13
by: | last post by:
From ASP I run a query using MIN(some_field/parameter) Now I need to pass this parameter to the query from ASP code How do I do that? Syntax like MIN( / ) does not work
9
by: Not Me | last post by:
Hi, I'm trying to grab records with a priority over those marked as yes (-1) in a certain field. Trying "select id, min(bit) from tab group by id" does not work, as the min operator doesn't...
3
by: Gunnar Vøyenli | last post by:
Hi I want to select the minium of two fields: create table a (f1 int, f2 int, f3 int) insert into a (f1, f2, f3) values (1,19, 150) insert into a (f1, f2, f3) values (2,18, 160) insert into a...
3
by: Claudio Grondi | last post by:
Trying to understand the outcome of the recent thread (called later reference thread): "Speed quirk: redundant line gives six-fold speedup" I have put following piece of Python code together:...
3
by: imani_technology_spam | last post by:
I know you can use the min function to get the first date within a recordset. However, is there a way to get the second date in a recordset? In other words, is there a way to get "min(date) + 1"...
5
Min
by: Gregc. | last post by:
Hi I am trying to find the min of a list of numbers. For example, if a user enters 10 numbers 1,2,3,4,5,6,7,8,9,9 then the min would be 1. I've looked as past posts on the topic, and there was...
4
by: jaip26 | last post by:
All, I came across a strange situation in my query. Basically here is the result of my query. col1 col2 col3 col4 col5 col6 col7...
4
by: Yansky | last post by:
Hi, just a quick question about the Math.min() function. If I have an array of numbers: var tempArray = ; how come Math.min() can't look at all the numbers in the array at once? i.e. - If I...
16
by: Peng Yu | last post by:
Hi, I'm wondering if there is a min function (in boost, maybe?) that accepts any number of arguments? std::min only accepts two arguments. If I want to get the minimum number out of many, I have...
1
by: teneesh | last post by:
I'm building a report for my boss and he wants the report to display a field that has the minimum value of all minimal values for 5 min fields. so for example, when i run this query - Select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.