ie expression ( CSS )

  • Thread starter Thread starter Kyong Kwak
  • Start date Start date
K

Kyong Kwak

I'm having a problem setting the expression to mimic "min-width"..
( first off, is this the right newsgroup? )

I'm trying to set a "select" and css syntax ( external file ) is:

select.setDDLWidth {
width: expression( ( this.clientWidth <= 200 ) ? "200px" : "auto";
}

now the problem is that it is fickle.. sometimes it works and sometimes
it doesn't. I'm using .aspx with viewstate on and such.. it seems that
the problem usually occurs when I'm posting back with data. I tried to see
if the width was set somehow but I didn't see anything.

the result is that it is fixed to 200px.

so on load it's set to "auto" because the content is.. say.. 400px..
when I post back.. it's set to "200px".. so it's clipping..

tell me what I'm missing here!! thanks a bunch!
 
Hi Kyong,

Here is a modified java code snippet originally from Folder.htt that is
called in the document.load event

<script language="javascript">
<!--
function Resize() {
if (document.body.clientWidth < Panel.style.pixelWidth * 2) {
Panel.style.visibility = "hidden";
ViewCtlFolder.style.pixelLeft = 0;
} else {
Panel.style.visibility = "visible";
ViewCtlFolder.style.pixelLeft = Panel.style.pixelWidth;
}
ViewCtlFolder.style.pixelWidth = document.body.clientWidth -
ViewCtlFolder.style.pixelLeft
}
function Initialize(){
Panel.style.visibility = "visible";
ViewCtlFolder.style.pixelLeft = Panel.style.pixelWidth;
ViewCtlFolder.style.pixelWidth = document.body.clientWidth -
ViewCtlFolder.style.pixelLeft;
ViewCtlFolder.Folder='Calendar';

Resize();
}
window.onresize = Resize;

//-->
I suppose the thing to note is that it uses pixelWidth. I am not sure if
this is the cause of your problem. You may also like to try sizeing
everything in em instead of px. Note also that a User Stylesheet or User
Font settings in IE will blow your styling away if they happen to choose a
different font size from your Form!

To see what is happening during your Form callbacks try Fiddler at
http://www.fiddlertool.com
 
Thanks Rob..

I'll be taking a look at the tool ( at first glance.. it seems very
helpful! ) in a little while.. but the comment on the pixelWidth.. I'm not
sure how to use that. Are you saying that I should use javascript? or css?
it'd be best if I used css ( and expressions for ie )..

let me know what you meant.. thank you again!
 
Hi Again Kyong,

Yes I suggest that you use java script instead of hardcoded styling. My
experience has been that it is uneconomic to use server side styling when
dealing with cross-browser issues. After all the User is King! The code
snippet I supplied was from Folder.htt so it is probably very solid. I feel
confident that the issue will be with the use of px i/o em as your sizing
basis.. but I could be wrong. It is up to you to do the hard work and make
the decision.

On second thoughts, after looking closely at your code, try assigning the
nowrap attribute to your containing tag. (client)

mmm. But I still think that scripting is a better option.
 
Hello Rob,

I tried the "noWrap" option to little avail.. I will script it and see if
that works.. thank you again! Have a wonderful thanksgiving!! ( if you're
in the states.. )
 
Hi Kyong,
Thanks for the warm response. I hope you have success. It is hard to make
judgements when you don't have the source in your face.
No. I am Australian. Ha Ha. Its too hot here to stuff a turkey! Surfs Up M8.
 
Back
Top