静态的html中,怎么在固定的 <DIV></DIV>中怎么调用JS实现手工分页的静态效果?
展开全部
<html>
<head>
<script>
function changeBody($id){
for(j=1;j<=2;j++){
document.getElementById("iDBody"+j).style.display = "none";
}
document.getElementById("iDBody"+$id).style.display = "";
}
function xx($id)
{
document.write('<div>成功了!'+$id+'</div>');
}
</script>
</head>
<body>
<div>
套个循环
<a href="javascript:changeBody(1);">模块A</a>
<a href="javascript:changeBody(2);">模块B</a>
</div>
<div style="display: none" id="iDBody1"><script>javascript:xx(1);
</script>
</div>
<div style="display: none" id="iDBody2"><script>javascript:xx(2);
</script>
</div>
</body>
</html>
<head>
<script>
function changeBody($id){
for(j=1;j<=2;j++){
document.getElementById("iDBody"+j).style.display = "none";
}
document.getElementById("iDBody"+$id).style.display = "";
}
function xx($id)
{
document.write('<div>成功了!'+$id+'</div>');
}
</script>
</head>
<body>
<div>
套个循环
<a href="javascript:changeBody(1);">模块A</a>
<a href="javascript:changeBody(2);">模块B</a>
</div>
<div style="display: none" id="iDBody1"><script>javascript:xx(1);
</script>
</div>
<div style="display: none" id="iDBody2"><script>javascript:xx(2);
</script>
</div>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询