91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

滑動刪除實現

發布時間:2020-07-08 10:18:21 來源:網絡 閱讀:1196 作者:liumanwei 欄目:移動開發
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=yes">
<title>TOUCH</title>
<style type="text/css">
    *{
        margin: 0;
        padding: 0;
    }
    body{
        -webkit-user-select: none;
    }
    body, button{
        font-family:'Microsoft YaHei', arial, helvetica, sans-serif;
    }
    .wrap{
        position: relative;
        height: 60px;
        border-bottom: 1px solid #ccc;
    }
    .container{
        position: relative;
        z-index: 2;
        width: 100%;
        height: 60px;
        display: -webkit-box;
        background-color: #FFF;
    }
    .trans{
        -webkit-transition: margin-left 0.2s linear;
        transition: margin-left 0.2s linear;
    }
    .head-img{
        width: 40px;
        height: 40px;
        line-height: 40px;
        background-color: #99F;
        border-radius: 3px;
        margin: 10px 0 0 10px;
        text-align: center;
        font-size: 12px;
        color: #FFF;
    }
    .content{
        margin: 10px 0 0 5px;
        -webkit-box-flex: 1;
    }
    .content p{
        font-size: 12px;
        color: #999;
        margin-top: 5px;
    }
    .del-btn{
        position: absolute;
        right: 0;
        top: 0;
        z-index: 1;
        width: 60px;
        height: 60px;
        line-height: 60px;
        background-color: #F00;
        color: #FFF;
        border: 0;
        font-size: 14px;
    }
</style>
</head>
<body>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <div class="wrap">
        <div class="container">
            <p class="head-img">圖片</p>
            <div class="content">
                <h6>騰訊新聞</h6>
                <p>云南魯甸強震已致379人遇難</p>
            </div>
        </div>
        <button class="del-btn">刪除</button>
    </div>
    <script type="text/javascript">
        var startPos = 0,
            endPos = 0,
            parent = null;
        document.body.addEventListener('click', function(e) {
            e.stopPropagation();
            e.preventDefault();
            var target = e.target;
            if(target.className.indexOf('del-btn') > -1) {
                alert('點擊了刪除');
            }
        }, false);
        document.body.addEventListener('touchstart', function(e) {
            parent = e.target;
            while(parent && parent.className.indexOf('container') < 0) {
                parent = parent.parentNode;
            }
            var touch = e.touches[0];
            startPos = touch.pageX;
            parent.className = 'container';
        }, false);
        document.body.addEventListener('touchmove', function(e) {
            var touch = e.touches[0],
                offset = 0;
            if(parent.className != 'container') {
                return;
            }
            endPos = touch.pageX;
            offset = endPos - startPos;
            if(offset > 0) {
                offset = 0;
                if(parent.className.length > 0) {
                    parent.className = parent.className + ' trans';
                } else {
                    parent.className = 'trans';
                }
            } else if(Math.abs(offset) > 60) {
                offset = -60;
            }
            parent.style.marginLeft = offset + 'px';
        }, false);
        document.body.addEventListener('touchend', function(e) {
            var offset = 0;
            if(parent.className != 'container') {
                return;
            }
            offset = endPos - startPos;
            if(offset < 0 && Math.abs(offset) > 30) {
                offset = -60;
            } else {
                offset = 0;
            }
            if(parent.className.length > 0) {
                parent.className = parent.className + ' trans';
            } else {
                parent.className = 'trans';
            }
            parent.style.marginLeft = offset + 'px';
        }, false);
    </script>
</body>
</html>




向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

清丰县| 大厂| 房山区| 原阳县| 盱眙县| 北票市| 乌拉特前旗| 东安县| 甘南县| 昭平县| 城市| 辰溪县| 藁城市| 武宣县| 秦安县| 余干县| 凤冈县| 双辽市| 新乡市| 雅江县| 玉溪市| 房产| 黔东| 霍林郭勒市| 丰县| 从化市| 济源市| 景德镇市| 临澧县| 淮南市| 盖州市| 青海省| 宁明县| 三河市| 阿克| 湖南省| 财经| 上饶县| 广西| 广德县| 那曲县|