*{padding:0;margin:0;}
.progress{width:200px;height:20px;background:yellow;position:relative;}
.progress-wrap{width:180px;height:100%;position:relative;}
.progress-bar{width:20px;height:20px;position:absolute;background:red;}
$(".progress").on("touchstart", function(e) {
alert(e.offsetX);
});
我想获取到当点击.progress-bar时他相对于.progress的距离,但是不知道为什么怎么都获取不到不只是什么原因?
demo在这里 http://codepen.io/anon/pen/Ob...
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。