html禁止图片拖拽移动在新窗口打开

一直觉得直接从网站的表格上复制数据挺方便的,

今天,领导突然说网站上的图片可以被别人拖走了,必须禁止,哎,果然只有领导才考虑得到这种事情啊

so,

将οndragstart="return false;" 加入Body中就可以了<body οndragstart="return false">

其它相关内容


οncοntextmenu="return false;" //禁止鼠标右键
οndragstart="return false;" //禁止鼠标拖动
onselectstart="return <br>false;"//文字禁止鼠标选中
οnselect="document.selection.empty();"//禁止复制文本

转载于:https://www.cnblogs.com/lyd2016/p/6600673.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Unity,您可以通过以下步骤来实现图片拖拽移动: 1. 创建一个空物体,并将其命名为“ImageContainer”。 2. 在ImageContainer下创建一个RawImage,并将其命名为“Image”。 3. 为RawImage添加一个BoxCollider组件,并将其勾选为“Is Trigger”。 4. 为ImageContainer添加一个脚本,并在脚本添加以下代码: ``` using UnityEngine; public class ImageDrag : MonoBehaviour { private bool isDragging = false; private Vector3 startPosition; private float deltaX, deltaY; void Update() { if (isDragging) { Vector3 mousePosition = Input.mousePosition; mousePosition.z = 10.0f; // Set this to be the distance you want the object to be placed in front of the camera. transform.position = Camera.main.ScreenToWorldPoint(mousePosition) + new Vector3(deltaX, deltaY, 0); } } private void OnMouseDown() { isDragging = true; startPosition = transform.position; Vector3 mousePosition = Input.mousePosition; mousePosition.z = 10.0f; // Set this to be the distance you want the object to be placed in front of the camera. Vector3 objectPosition = Camera.main.ScreenToWorldPoint(mousePosition); deltaX = objectPosition.x - transform.position.x; deltaY = objectPosition.y - transform.position.y; } private void OnMouseUp() { isDragging = false; if (transform.position.y < -3) // Set this to be the y-coordinate where you want the object to snap back to its starting position. { transform.position = startPosition; } } } ``` 5. 在Unity编辑器,选择ImageContainer并将Image拖放到RawImage的Texture属性。 现在,您可以在场景拖动ImageContainer来移动图片。当您松开鼠标时,如果图片的位置低于指定的y坐标,它将自动回到其起始位置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值