我希望这个 div 在选择菜单时显示并向上移动。请任何人都可以帮助解决问题。非常感谢
<html><head>
<script type="text/javascript">
<!--
var divobject = null;
function init(id){
divobject = document.getElementById('id');
divobject.style.left = '25px';
divobject.style.top = '580px';
divobject.style.visibility = 'hidden';
}
function moveUp(id){
divobject = document.getElementById(id);
divobject.style.visibility = 'visible';
divobject.style.left = '25px';
divobject.style.top = parseInt(div.style.top) + 0 + 'px';
divobject.style.position = 'absolute';
}
document.onclick =init;
window.onload =init;
//-->
</script>
</head>
<body>
<a href="javascript:void(moveup('1'));">show div</a>
<div id="1">tytt</div>
</body>