css 禁止滚动条 测试

.sp-message-open {
      margin-top: 0px !important;
      overflow: hidden !important;
      left: 0 !important;
      right: 0 !important;
      top: 0 !important;
      bottom: 0 !important;
      position: fixed  !important;
    }

        .tp-modal-open {
            overflow: hidden !important; /*是否显示滚动条*/
            -webkit-overflow-scrolling: touch; /*使用具有回弹效果的滚动, 当手指从触摸屏上移开*/
        }

            .tp-modal-open.tp-modal-resizing {
                -webkit-overflow-scrolling: auto; /* 使用普通滚动, 当手指从触摸屏上移开,滚动会立即停止 */
            }

        .tp-modal {
            overflow-x: hidden;    /*水平滚动条*/
            overflow-y: scroll;  
            display: none;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            transform: translate3d(0, 0, 0);
        }

 

 //去除dom元素

    var t =document.getElementsByTagName("script")
    for(var i=0;i<t.length;i++)
    {
        t[i].parentNode.removeChild(t[i]);
        //t[i].remove();
    }
console.log(t);
var t =document.getElementsByTagName("meta")
    for(var i=0;i<t.length;i++)
    {
        t[i].parentNode.removeChild(t[i]);
        //t[i].remove();
    }
console.log(t);

// .sp-message-open

 ------------------------------------

   function func(index)
    {
        var obj = document.getElementsByTagName("script")[0];
        if(obj) //存在
        {
            obj.parentNode.removeChild(obj);
            console.log(index);
            func(index++);
        }
    }
    func(0);

 

posted @ 2020-02-11 11:25  enych  阅读(1962)  评论(0编辑  收藏  举报