Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionfunction getcom(id, i) { if(!isNaN(id)) document.getElementById('c' + id).style.height = '0px'; else { var reg = /c/; var str = id; var newid = str.split(reg); document.getElementById(parseInt(newid[1]), 10).style.height = '0px'; } var ob = document.getElementById(id); i += 4; ob.style.height = i + "px"; if (ob.offsetHeight < ob.scrollHeight) { setTimeout(function() { getcom(id, i); }, 10); } } function hidecom(id) { var ob, i; if(parseInt(document.getElementById(id).style.height, 10) < parseInt(document.getElementById('c' + id).style.height, 10)) { ob = document.getElementById('c' + id); i = ob.style.height; } else { ob = document.getElementById(id); i = ob.style.height; } i -= 4; ob.style.height = i + "px"; if (i > 0) { setTimeout(function() { hidecom(id); }, 10); } }
[javascript:hidecom('0'); cacher ] [javascript:getcom('c0', 0); ajouter un commentaire ] - [javascript:getcom('0', 0); pas de commentaire ]
var ie false; /*@cc_on ie true; @*/ if (ie) alert(document.getElementById("toto").currentStyle.position+"\r\n"+ document.getElementById("tata").currentStyle.position+"\r\n"+ document.getElementById("titi").currentStyle.position+"\r\n"+ document.getElementById("tata").currentStyle.fontFamily+"\r\n"+ document.getElementById("toto").currentStyle.backgroundColor ); else alert(window.getComputedStyle(document.getElementById("toto"),null).position+"\r\n"+ window.getComputedStyle(document.getElementById("tata"),null).position+"\r\n"+ window.getComputedStyle(document.getElementById("titi"),null).position+"\r\n"+ window.getComputedStyle(document.getElementById("tata"),null).fontFamily+"\r\n"+ window.getComputedStyle(document.getElementById("toto"),null).backgroundColor );
function getcom(id, i) { var ob = document.getElementById(id); i++; ob.style.height = i + "px"; if (ob.offsetHeight < ob.scrollHeight) { setTimeout(function() { getcom(id, i); }, 10); } } function hidecom(id, i) { var ob = document.getElementById(id); if (!i) { var i = parseInt(ob.style.height, 10); } i--; ob.style.height = i + "px"; if (i > 0) { setTimeout(function() { hidecom(id, i); }, 1); } }