I’m busy creating a resizer, but on reloading it first switches from 100% until loading the cookie and setting the width to something fixed:
//set width from cookie, unfortunately we need todo this on docready because #main-container is not done rendering -_-
var width = $.cookie("width");
// Set the user's selection for the left column
if (width != null) {
if (width == "fluid") {
alert("fluid!");
$('#main-container').addClass('width-fluid');
} else {
$('#main-container').addClass('width-fixed');
}
} else {
$('#main-container').addClass('width-fixed');
};
Any ideas?
Thanks,
Dennis
just set the default css property “height” and “width” as 0 inline or in a external css file, then when the cookie is loaded, it will set it to what you want.
ex. of inline default css (before js affects it)
I’m assuming you’re dealing with a block-level element (image), if not you might want to also set the element to “display:block” so it will respect the height and width.