Zrobiłem coś takiego:
var pop;
function rozwin() {
var obj = document.getElementById("divek");
if(parseInt(obj.style.height)<100){
obj.style.width = parseInt(obj.style.width) + 4 + 'px';
obj.style.height = parseInt(obj.style.height) + 1 + 'px';
}
}
function zwin() {
var obj = document.getElementById("divek");
if(parseInt(obj.style.height)>10){
obj.style.width = parseInt(obj.style.width) - 4 + 'px';
obj.style.height = parseInt(obj.style.height) - 1 + 'px';
}
}
function wywolaj() {
if(pop!="marked"){
var obj = document.getElementById("divek");
obj.style.display = "block";
setInterval("rozwin()", 10);
pop = "marked";
}else{
var obj = document.getElementById("divek");
obj.style.display = "block";
setInterval("zwin()", 10);
pop = " ";
}
}
i rozwija się elegancko, ale chciałbym, żeby po ponownym kliknięciu 'Klik' się zwijało - no i cos się zacina jak tylko zacznie zwijac :/
---update
jak sobie dodałem alert('xx'); w za zamknięciem IF'a
if(parseInt(obj.style.height)<100){...}alert('xx');
to mi go wywala nawet gdy juz przestało rozciągać DIVa..jak zabić ten proces gdy zostanie osiągnięty rozmiar określony IFem? bo to to zapewne jest przyczyną..