Are you using the dimensions plugin?  It helps with this sort of thing.
I think your approach sounds fine.  Although, I might look at the parent
width of the object rather than the window.  That way 600 isnt hard coded.
If you do it that way, then you dont need the dimensions plugin at all.

Glen

On Dec 31, 2007 3:32 PM, Mike Schinkel <[EMAIL PROTECTED]> wrote:

>
> Hi all:
>
> I'm struggling with this one.  I need the following, which I can't get to
> work because IE7 seems to have a bug where when you set the width of an
> <input> field using CSS to a percentage it calculates based on the
> viewport
> and not the containing element.  So I figured I'd add an IE fix like the
> following, but I can't get it to work.  FYI, there is a class of
> "text-field" on the <input> elements.
>
> $(document).ready(function(){
>        window.onresize = function() {
>                var width = '' + (window.innerWidth - 600);
>                $('input.text-field').css("width",width);
>        }
> });
>
> I know my approach is probably all wrong anyway, so go lightly on me and
> recommend a more jQueryish way to do this; this is all new to me and I'm
> just trying figure things out.
>
> --
> -Mike Schinkel
> http://www.mikeschinkel.com/blogs/
> http://www.welldesignedurls.org
> http://atlanta-web.org
>
>

Reply via email to