1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<%@ page language="java" contentType="text/html; charset=US-ASCII"
pageEncoding="US-ASCII"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Insert title here</title>
<style type="text/css">
div
{
width: 150px;
height: 45px;
border: 1px dotted black;
}
</style>
<script type="text/javascript">
$(function(){
$('.item').draggable({
revert:true,
proxy:'clone',
onStartDrag:function(){
$(this).draggable('options').cursor = 'not-allowed';
$(this).draggable('proxy').css('z-index',10);
},
onStopDrag:function(){
$(this).draggable('options').cursor='move';
}
});
$('.drop').droppable({
onDragEnter:function(e,source){
$(source).draggable('options').cursor='auto';
},
onDragLeave:function(e,source){
$(source).draggable('options').cursor='not-allowed';
},
onDrop:function(e,source){
cor=$(e.target).find('p:eq(0)').text();
name=$(source).find('p:eq(0)').text();
if (name==cor) {alert(" succes" +cor+"/"+name);}
else {alert("fail cor val="+cor.length+"name="+name.length);};
}
});})
</script>
</head>
<body>
<a href="#" class="item">
<div><p>a B</p></div>
</a>
<br><br>
<a href="#" class="drop" >
<div><p style="display:none;">a B</p></div>
</a>
<br><br>
<a href="#" class="drop">
<div><p style="display:none;">A b</p></div>
</a>
</body>
</html> |
Partager