Ticket #5722: dnd.html

File dnd.html, 1.2 KB (added by vigo, 11 years ago)

Sample file accompanying the "steps to reproduce"

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
3<html>
4
5<head>
6<title>Bug or Documentation Issue</title>
7
8<style type="text/css">
9.box {
10  width: 100px;
11  height: 100px;
12  margin-left: 30px;
13  background: orange;
14  float: left;
15}
16</style>
17
18<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
19<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
20
21<script type="text/javascript">
22function initDnd() {
23  $(".left").droppable({
24    //scope: "left"
25  });
26 
27  $(".right").draggable({
28    //scope: "left"
29  });
30}
31
32function killDnd() {
33  $(".left").droppable("destroy");
34}
35
36function buildBoxes() {
37  var html = '<div class="left box"></div><div class="right box"></div>';
38  $("#boxesDyn").html(html);
39}
40
41$(function() {
42  buildBoxes();
43  initDnd();
44});
45</script>
46
47
48<body>
49
50<div id="boxesDyn"></div>
51
52 <p style="clear: left"></p>
53 
54<p style="margin-top: 2em">
55        <button type="button" onclick="buildBoxes()">buildBoxes</button>
56        <button type="button" onclick="killDnd()">killDnd</button>
57        <button type="button" onclick="initDnd()">initDnd</button>
58</p>
59
60</body>