And here's a more fixed version that does handle resize. :)
var myDiv = $('#myDiv');
// Fixes an IE bug where percentages are used to define the height of
the container
if ($.browser.msie)
{
var ieHeight= myDiv.css ('height');
if (ieHeight.match ('%'))
{
Ahh nice work. :)
--
Brandon Aaron
On 8/10/07, Gordon <[EMAIL PROTECTED]> wrote:
>
>
> I gave it a bit more thought and came up with this idea. It's not
> perfect, the div will be size locked after it executes so some resize
> event molarky will be necessary, but it does have the advantage that
I gave it a bit more thought and came up with this idea. It's not
perfect, the div will be size locked after it executes so some resize
event molarky will be necessary, but it does have the advantage that
it uses the size specified in the stylesheet if it happens to be a
percentage
if ($.browser
Then you have to go in and change that .7 to .85. :p Actually I'll use a
config file for stuff like this. It is Where all my plugins options, etc are
stored. Makes changes like this as easy as it is with CSS.
--
Brandon Aaron
On 8/10/07, Gordon <[EMAIL PROTECTED]> wrote:
>
>
> I had thought of
I had thought of that but I think that it would probably be an option
of last resort, on the grounds that doing that would be breaking the
seperation between presentation, content and behaviour. What happens
if the designer decides he wants the window height to change to 65% or
85% six months dow
If the 70% is relative to the height of the window, you could just get the
height of the window and multiply it by .7. Just include dimensions and run
something along the lines of this:
$(function() {
var fixHeight = function() {
$('#foo').height( $(window).height()*.7 );
};
fi
6 matches
Mail list logo