1 function barre_forcer_hauteur () {
2 jQuery(".markItUpEditor").each(function() {
3 var hauteur_min
= jQuery(this).height();
4 var hauteur_max
= parseInt(jQuery(window
).height()) - 200;
5 var hauteur
= hauteur_min
;
7 var signes
= jQuery(this).val().length
;
9 /* en gros: 400 signes donnent 100 pixels de haut */
10 var hauteur_signes
= Math
.round(signes
/ 4) + 50;
11 if (hauteur_signes
> hauteur_min
&& hauteur_signes
< hauteur_max
)
12 hauteur
= hauteur_signes
;
14 if (hauteur_signes
> hauteur_max
)
15 hauteur
= hauteur_max
;
17 jQuery(this).height(hauteur
);
22 jQuery(window
).bind("load", function() {
23 barre_forcer_hauteur();