怎么让橘色的条子从前面一直延伸,类似与loading功能的.<!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>
<style type="text/css">
ul{list-style:none;}
*{margin:0;padding:0;}
#wrap{width:200px;margin:0 auto;overflow:hidden;height:102px;overflow-x:auto;border:1px solid blue;}
#con{width:250%;}
#list1{float:left;margin-top:2px;width:100px;height:10px;background:orange;}
</style>
</head>
<body> <div id="wrap">
<div id="con">
<div id="list1">
</div>
<div style="clear:both"></div>
</div>
</div>
<div id="num"></div>
<script type="text/javascript">
var $ = function (id){ return document.getElementById(id)};
var wrap = $("wrap");
var list1 = $("list1");
var list2 = $("list2");
var num = $("num");
var time =10;
function autoScroll(){
if(list1.offsetWidth - wrap.scrollLeft <= 0){
wrap.scrollLeft = list1.offsetWidth - wrap.scrollLeft;
clearInterval(m);
}
else{
wrap.scrollLeft++;
num.innerHTML = wrap.scrollLeft +"%";
}
}
var m = setInterval("autoScroll()",10);
wrap.onmouseover = function(){
clearInterval(m);
}
wrap.onmouseout = function(){
m=setInterval("autoScroll()",10);
}
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
ul{list-style:none;}
*{margin:0;padding:0;}
#wrap{width:200px;margin:0 auto;overflow:hidden;height:102px;overflow-x:auto;border:1px solid blue;}
#con{width:250%;}
#list1{float:left;margin-top:2px;width:100px;height:10px;background:orange;}
</style>
</head>
<body> <div id="wrap">
<div id="con">
<div id="list1">
</div>
<div style="clear:both"></div>
</div>
</div>
<div id="num"></div>
<script type="text/javascript">
var $ = function (id){ return document.getElementById(id)};
var wrap = $("wrap");
var list1 = $("list1");
var list2 = $("list2");
var num = $("num");
var time =10;
function autoScroll(){
if(list1.offsetWidth - wrap.scrollLeft <= 0){
wrap.scrollLeft = list1.offsetWidth - wrap.scrollLeft;
clearInterval(m);
}
else{
wrap.scrollLeft++;
num.innerHTML = wrap.scrollLeft +"%";
}
}
var m = setInterval("autoScroll()",10);
wrap.onmouseover = function(){
clearInterval(m);
}
wrap.onmouseout = function(){
m=setInterval("autoScroll()",10);
}
</script>
</body>
</html>
解决方案 »
- 怎么在每个div处点击后都显示在屏幕的正中间啊?
- 查询分页问题
- 按回车键焦点跳到下一个控件,页面中文本框控件和按钮控件数量不确定
- window.onload是页面加载完成才执行,请问页面一开始就执行怎么写?
- 请问这个表单所提交的地址是什么?
- 求助:js无限目录树,带checkbox,选中后,其所有子目录也同时被选中。
- 谁能帮我解释一下这是什么意思?
- 如何在拖动层的时候避免页面出现滚动条以及一些东西被选中而页面变形
- 在用javascript做计算时,怎样格式话结果浮点数小数点后的位数
- 使IE打印网页的时候,不打印页眉页脚的当前日期、网页地址,当前页码格式等******************************
- jquery或js判断class属性
- js flash相册问题
弄个gif的图片就OK了。