|
|
|
| Не могу разобраться в чем проблема, браузер виснит при выполнении данного скрипта, а опера вообще не выполняет его и пишит, что переменная showProjectMenu не определена.
<div style="position:relative; overflow:hidden; height:10px;width:100%" onMouseClick="showProjectMenu(this)" onMouseOver="showProjectMenu(this)" onMouseOut="hideProjectMenu(this)">то что надо показать</div>
<script>
function showProjectMenu(elem){
while(elem.clientHeight<62){
setTimeout(function() {elem.style.height=elem.clientHeight+1}, 50);
}
return;
}
</script>
|
хотя вот так скрипт отрабатывает правильно
<script>
function showProjectMenu(elem){
setTimeout(function() {elem.style.height=elem.clientHeight+1}, 50);
return;
}
</script>
|
| |
|
|
|
|
|
|
|
для: DIM@
(13.09.2009 в 21:24)
| |
<script>
function showProjectMenu(elem){
var _this = this;
var timer = setTimeout(function() { if(elem.clientHeight<62) {elem.style.height=elem.clientHeight+1}else{clearTimeout(_this.timer); return;}}, 50);
return;
}
</script>
|
| |
|
|
|