-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
84 lines (65 loc) · 1.95 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE HTML>
<html>
<head>
<title>demo</title>
<link rel="stylesheet" type="text/css" href="reset.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('button').click(function() {
addItem();
});
$('ul').dblclick(function(e){
var hashkey = ($(e.target).attr('hash'))
var url;
if(!hashkey) {
url = 'form.html';
}
else {
url = 'http://www.google.com/'+hashkey
}
showLightbox(url);
})
});
function showLightbox(url) {
$('#overlay').show();
var overlayBox = $('<div class="overlaybox"><div class="inner"></div><span class="close">X</span></div>').appendTo('body');
$.ajax({ url: url, success: function(content){
$(overlayBox.children('.inner')[0]).html(content);
}});
}
$('.close').live('click', function() {
$('.overlaybox').remove();
$('#overlay').hide();
});
$('#saveme').live('click', function() {
//close window
//define the hash
alert('saved');
return false;
})
var count = 0;
function addItem() {
//console.log($('#inner').width());
newItem = $('<li class="item">'+(count++)+'</li>').appendTo('#inner');
newItem.fadeIn('fast', function() {
$('li').sortable();
});
//console.log(newItem.outerWidth(true));
$('#inner').width($('#inner').width()+newItem.outerWidth(true));
$('#container')[0].scrollLeft = $('#container')[0].scrollWidth;
$('ul').sortable();
}
</script>
</head>
<body>
<div id="container">
<ul id="inner">
</ul>
</div>
<button>Add One</button>
<div id="overlay"></div>
</body>
</html>