#element {
height: expression((function(element) {
var x = window.setInterval (function () {
if (document.readyState.search (/loaded|complete/) > -1) {
window.clearTimeout (x);
$(element).height($(element).parent.height())
}
}, 50);
})(this));
}
Let me explain: Firstly, expressions are bad. Follow dlablin's link to read why. You should consider other methods. If you must, the above snippet works as follows:
The expression is first evaluated as soon as the CSS is read. That means, the DOM is not yet ready and jQuery is probably not yet loaded.
Set as expression an anonymous function, that is instantaneously executed.
This function delivers the current element as element
to the containing code.
We set an interval: Check every 50ms, if the DOM is ready. If it is, clear the interval and run the jQuery.
Remark: If you do this with lots of elements, this will really slow down your page. To emphasize this again: Don't do this at home, kids!