好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

h5曲线滑动确认

h5项目需根据几条弯曲的线条让用户进行曲线式滑动,滑动时需实时响应某些样式,于是就有了下面这个实例。(可自定义多个子对象大小分别放在线条各处,以增加曲线滑动确认精度。)

 
 
 
 
 手机端触屏手指曲线滑动确认 
 
 
var touch_screen = {
    //曲线滑动确认
    curve_confirm: {
        _object: null,
        _object_children_length: null,
        _object_children:null,
        _is_start: false,
        _fn: function() {},
        start: function() {
            var self = this;
            //开始滑动
            var start = function(e) {
                self._is_start = true;
                for (var i = 0, j = self._object_children_length; i  = _left && x   _top && y  

 
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}
#curve_item div {
    background: #0F6;
    position:absolute;
    width:50px;
    height:50px;
}
#curve_item #a { top:20px; left:20px; }
#curve_item #b { top:100px; left:100px; }
#curve_item #c { top:200px; left:200px; }
#curve_item #d { top:300px; left:100px; }
#curve_item #e { top:400px; left:20px; }
 
 

 

查看更多关于h5曲线滑动确认的详细内容...

  阅读:41次