jquery鼠标拖拽,拖到指定位置,触发事件?求源码
1个回答
推荐于2017-09-28
展开全部
<!DOCTYPE HTML>
<html>
<head>
<meta charset=UTF-8>
<title>YuGiOh</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
outline: 0;
vertical-align: baseline;
}
body {
background-color: #7E0000;
}
div {
margin: auto;
border-radius: 360px;
}
.out {
background-color: orange;
width: 300px;
height: 300px;
}
.in {
position: relative;
background-color: pink;
width: 50px;
height: 50px;
top: 125px;
}
.btn {
position: relative;
color: white;
text-shadow: 0px 0px 1px rgb(204, 204, 204);
font: 40px 微软雅黑;
border: 1px solid yellow;
width: 40px;
height: 40px;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.btn.a {
left: -128px;
}
.btn.b {
left: 123px;
top: -57px;
}
.btn.c {
left: 124px;
top: 53px;
}
.btn.d {
left: -130px;
}
</style>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script type="text/javascript">
var doc = $ (document).ready (function ()
{
})[0];
doc.ondragstart = doc.onselectstart = doc.oncontextmenu = function ()
{
return false;
}
</script>
</head>
<body>
<div class="out">
<div class="in"></div>
<div class="btn a">1</div>
<div class="btn b">2</div>
<div class="btn c">3</div>
<div class="btn d">4</div>
</div>
</body>
</html>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询