完整代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title> jq拖动进度条效果百分比 </title>
</head>
<style>
*{margin:0}
</style>
<body>
<div id="d1" name="wrap" style="width:300px;height:60px; border: 1px solid #000;margin-top:20px;" >
<div id="bg" style="float: left;width: 80px;height: 60px;background-color: #e4b54c;"></div>
<div id="drag" style="float: left;width: 20px;height: 60px;background-color: #78ba54;"οnmοuseοver="this.style.cursor='pointer'"></div>
<p id="p1"style="clear:both;">水平坐标:</p>
<p id="p2">