...
| Bloc de code |
|---|
(function($){
$(document).ready(function(){
var resizeFrame = function(frame) {
var height = $(frame).contents().find("html").attr('scrollHeight');
if (height === undefined) return;
// for firefox, one could use $(frame).contents().find("html").height()
// which works without needing to set height to 0 first
$(frame).css({height: 0});
var height = $(frame).contents().find("html").attr('scrollHeight');
if (height > 0) {
var horiz_scroll_heigth = 20;
$(frame).css({height: height + horiz_scroll_heigth});
}
};
$('iframe').load(function() {
resizeFrame(this);
});
});
})(jQuery);
|