网页CSS加JS问题,
<divid="test"style="position:relative;margin:0auto;height:424px;overflow:hidden"><ols...
<div id="test" style="position:relative;margin:0 auto;height:424px;overflow:hidden"><ol style="list-style:none;width:84px;padding:0;height:82500px;overflow:hidden;*position:relative;*zoom:1">test</ol></div>
当ol里的内容高度超过424的时候,后面的内容就不显示出来,
如果用JS操作这个DIV 做到一种滚动效果, 因为要给这个DIV的滚动条做皮肤
所以不想用默认的,JS操作什么属性才能让DIV滚动. 展开
当ol里的内容高度超过424的时候,后面的内容就不显示出来,
如果用JS操作这个DIV 做到一种滚动效果, 因为要给这个DIV的滚动条做皮肤
所以不想用默认的,JS操作什么属性才能让DIV滚动. 展开
2个回答
展开全部
<script type="text/javascript">
var y1 = -1;
window.document.onmousedown=function(){
y1 = event.y;
window.status = y1 + " ";
};
window.document.onmouseup=function(){
y1 = -1;
window.status += y1 + " ";
};
window.document.onmousemove=function(){
if(y1!=-1){
document.getElementById("div").scrollTop += event.y - y1;
y1 = event.y;
window.status += y1 + " ";
}
};
</script>
var y1 = -1;
window.document.onmousedown=function(){
y1 = event.y;
window.status = y1 + " ";
};
window.document.onmouseup=function(){
y1 = -1;
window.status += y1 + " ";
};
window.document.onmousemove=function(){
if(y1!=-1){
document.getElementById("div").scrollTop += event.y - y1;
y1 = event.y;
window.status += y1 + " ";
}
};
</script>
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
var y1 = -1;
window.document.onmousedown=function(){
y1 = event.y;
window.status = y1 + " ";
};
window.document.onmouseup=function(){
y1 = -1;
window.status += y1 + " ";
};
window.document.onmousemove=function(){
if(y1!=-1){
document.getElementById("test").scrollTop += event.y - y1;
y1 = event.y;
window.status += y1 + " ";
}
};
</script>
<body>
<div id="test" style="position:relative;margin:0 auto;height:424px;overflow:hidden">
<ol style="list-style:none;width:84px;padding:0;height:82500px;overflow:hidden;*position:relative;*zoom:1">
test</ol>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
var y1 = -1;
window.document.onmousedown=function(){
y1 = event.y;
window.status = y1 + " ";
};
window.document.onmouseup=function(){
y1 = -1;
window.status += y1 + " ";
};
window.document.onmousemove=function(){
if(y1!=-1){
document.getElementById("test").scrollTop += event.y - y1;
y1 = event.y;
window.status += y1 + " ";
}
};
</script>
<body>
<div id="test" style="position:relative;margin:0 auto;height:424px;overflow:hidden">
<ol style="list-style:none;width:84px;padding:0;height:82500px;overflow:hidden;*position:relative;*zoom:1">
test</ol>
</div>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询