function agrandir_admin(id, i, hmax, frein, plus, moins, global){
if (i==0){
var hmax = document.getElementById(id).offsetHeight;
var frein = document.getElementById(id).offsetHeight;
document.getElementById(id).style.height = 0+'px';
document.getElementById(id).style.position = 'relative';
document.getElementById(plus).style.display = 'none';
document.getElementById(moins).style.display = 'block';
document.getElementById(global).style.backgroundPosition = 'top';
frein = frein - 26;
}
if (frein>=900){
document.getElementById(id).style.height = hmax+'px';
document.getElementById(id).style.visibility = 'visible';
}else if (i<=frein){
i=i+25;
document.getElementById(id).style.height = i+'px';
setTimeout( function() { agrandir_admin(id, i, hmax, frein, plus, moins, global); }, 50 );
}else if (i<=frein+20){
i=i+2;
document.getElementById(id).style.height = i+'px';
setTimeout( function() { agrandir_admin(id, i, hmax, frein, plus, moins, global); }, 80 );
}else if(( i<=hmax )&&(i>=frein)){
i++;
document.getElementById(id).style.height = i+'px';
setTimeout( function() { agrandir_admin(id, i, hmax, frein, plus, moins, global); }, 1 );
}else{
document.getElementById(id).style.visibility = 'visible';
}
}
function reduir_admin(id, i, hmax, hmaxValue, plus, moins, global){
if (i==0){
document.getElementById(id).style.visibility = 'hidden';
var hmax = document.getElementById(id).offsetHeight;
var hmaxValue = document.getElementById(id).offsetHeight;
document.getElementById(plus).style.display = 'block';
document.getElementById(moins).style.display = 'none';
document.getElementById(global) .style .backgroundPosition = 'bottom';
}
if (hmax>=900){
document.getElementById(id).style.height = 0+'px';
document.getElementById(id).style.position = 'absolute';
document.getElementById(id).style.height = hmaxValue+'px';
}else if (hmax > 0){
i=i+25;
hmax = hmax-i;
document.getElementById(id).style.height = hmax+'px';
setTimeout( function() { reduir_admin(id, i, hmax, hmaxValue, plus, moins, global); }, 50 );
}else{
document.getElementById(id).style.height = 0+'px';
document.getElementById(id).style.position = 'absolute';
document.getElementById(id).style.height = hmaxValue+'px';
}
}
J'ai un peu la fleme de détailler mais ca marche comme je veux ;)
Merci de ton aide!
Az