<html>
<head>
<title>展的折叠、展开</title>
<style>
#content {
font-size: 14px;
width: 1000px;
height: 500px;
background: #eee;
padding: 10px;
border: 4px #ccc double;
overflow: hidden;
}
#key {
color: red;
float: right;
margin-top: 0px;
}
</style>
<script>
var s=50;
var minheight=50;
var maxheight=500;
function shoppingcat(){
var key = document.getElementById("key").innerText;
if(content.style.pixelHeight==0)content.style.pixelHeight=minheight;
if(key=="展开"){
content.style.pixelHeight+=s;
if(content.style.pixelHeight<maxheight){
setTimeout("shoppingcat();",1);
}else{
document.getElementById("key").innerText="关闭";
}
}else{
content.style.pixelHeight-=s;
if(content.style.pixelHeight>minheight){
setTimeout("shoppingcat();",1);
}else{
document.getElementById("key").innerText="展开";
}
}
}
</script>
</head>
<body>
<span id="key" οnclick="shoppingcat();">展开</span>
<div id="content">
源码爱好者
<br><br>
源码爱好者源码下载。
</div>
</body>
</html>
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
IDEA 展开文件目录树,折叠文件目录树,展开代码,折叠代码
方式一:IDEA自带展开快捷键:小键盘:展开当前文件夹:+展开所有文件夹:*IDEA自带折叠快捷键:折叠当前文件夹:- ..
intellij idea 快捷键 递归 代码块 ide -
Android viewgroup设置不可点击
安卓强制登录下线(静态和动态方法)静态广播与动态广播的区别 1、动态注册的广播永远要快于静态注册的广播,不管静态注册的优先级设置的多高,不管动态注册的优先级有多低2、生存期,静态广播的生存期可以比动态广播的长很多,因为静态广播很多都是用来对系统时间进行监听,比如我们可以监听手机开机。而动态广播会随着context的终止而终止3、动态广播无需在AndroidManifest.xml中声明即可直接使用
安卓强制登录下线 安卓动态广播强制登录下线 安卓静态广播强制登录下线 安卓静态广播和动态广播区别 强制登录下线