zoukankan      html  css  js  c++  java
  • 禁止图片拖拽和文字被选中

    禁止图片拖拽

    method1

    img{pointer-events:none} ,firefox支持,IE不支持

    method2

    <body  ondragstart='return false'></body> || img{ondragstart='return false'}

    method3

    <body onselectstart='return false' onselectstart='no' style="-moz-user-select:none;">

    method4

    obj.onmousemove=function(ev){

      ev.preventDefault()

    }

    method5

    obj.onmouseenter=function(ev){

      //设置捕获

      this.setCapture && this.setCapture()

    }

    obj.onmouseleave=function(ev){

      //清除捕获

      this.releaseCapture && this.releaseCapture()

    }

    禁止文字选中

     body{

      -webkit-touch-callout: none;

      -webkit-user-select: none;

      -khtml-user-select: none;

      -moz-user-select: none;

      -ms-user-select: none;

      user-select: none;

    }

     

  • 相关阅读:
    Binary Trees
    [POJ] String Matching
    Tree
    Maxmum subsequence sum problem
    poj 2104 划分树
    poj 2486 树形dp
    poj 1848 树形dp
    hdu 4578 线段树
    hdu 4585 set应用
    hdu 2412 树形DP
  • 原文地址:https://www.cnblogs.com/xshaohua-com/p/6632256.html
Copyright © 2011-2022 走看看