这是今天写的进度条案例,主要用到了鼠标事件,分享出来给大家~
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>进度条</title>
<style>
#progress{
width: 1000px;
height: 35px;
line-height: 35px;
margin: 100px auto;
position: relative;
}
#progress_bar{
width: 900px;
height: 100%;
background: #e8e8e8;
border-radius: 8px;
}
#progress_bar_fg{
width: 0;
height: 100%;
background: orange;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}
span{
position: absolute;
top: -7px;
left: 0;
width: 30px;
height: 49px;
background: orange;
border-radius: 5px;
cursor: pointer;
}
#progress_value{
position: absolute;
right: 30px;
top: 0;
}
</style>
</head>
<body>
<div id="progress">
<div id="progress_bar">
<div id="progress_bar_fg"></div>
<span></span>
</div&g