-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnd.html
57 lines (49 loc) · 1.58 KB
/
dnd.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>DND</title>
<link rel="stylesheet" href="css/style.css">
<style>
#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; display: inline;}
#sortable li span { position: absolute; margin-left: -1.3em; }
</style>
</head>
<body>
<div class="wrapper">
<p>Drag and drop text to create a word</p>
<p>Hint: in english it's called picture</p>
<ul id="sortable">
<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>ட</li>
<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>ம்</li>
<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>ப</li>
</ul>
</div><!-- /wrapper -->
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
$(function() {
$( "#sortable" ).sortable({
//handle : '.handle',
axis:'x',
stop: function(event, ui) { checkIfCorrect();}
//containment: 'document'*/
});
$( "#sortable" ).disableSelection();
/* $('li').each(function(index) {
var currArr = $(this).text();
//console.log(index);
console.log(currArr);
});*/
function checkIfCorrect() {
var currArr = new Array();
$('li').each(function(index) {
currArr.push($(this).text());
if (currArr.join("") == "படம்") {alert("Correct!")}
});
}
});
</script>
</body>
</html>