From: "Aaron Gray" <[EMAIL PROTECTED]>
Subject: Re: [css-d] float: right does not work via DOM - looking for
substitute
To: "Ms2ger" <[EMAIL PROTECTED]>
Cc: CSS-D <[email protected]>, Philippe Wittenbergh
<[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="UTF-8";
reply-type=response
> Aaron Gray wrote:
>>> On Oct 4, 2008, at 3:09 AM, Aaron Gray wrote:
>>>
>>>> Yes I know it works in HTML and CSS.
>>>>
>>>> BUT it does NOT work dynamically via DOM using Javascript.
>>>>
>>>> On IE7, FF3.0.1, Opera9.51 my test program fails but it works on
>>>> Safari and Chrome.
>>>>
>>>> What I want is an alternative to 'float:right' if there is one.
>>> Can you provide an example that actually shows the issue ? Otherwise,
>>> one can only speculate.
>>
>> Okay, I have done an example in plain Javascript without my library :-
>>
>> http://www.aarongray.org/Examples/CSS/floatRight.html
>>
>> It works on WebKit based browsers but not on IE7, FF3.0.1, or Opera 9
>>
>
> The solution is to use |.style.styleFloat| and |.style.cssFloat|.[1]
>
> [1]
> http://www.demay-fr.net/blog/index.php/2008/01/22/99-stylefloat-vs-stylecssfloat-vs-stylestylefloat
>Yes, thanks alot.
>Feeling very dumb,
>Aaron
Worth noting perhaps that you could keep the style information in a CSS file
and use JavaScript to change the class attribute of the eleemnt you wish to
float. You will still come across a similar problem with IE in that you have to
set both the class and className attributes. Something like this:
element=document.getElementById('myEL');
element.setAttribute('class','right');
element.setAttribute('className','right');
No doubt your chosen library provides a one-line method for doing the above
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/