-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
66 lines (58 loc) · 2.1 KB
/
example.html
File metadata and controls
66 lines (58 loc) · 2.1 KB
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
<!DOCTYPE HTML>
<html>
<head>
<title>jQueryUI Init Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
<script src="livequery/jquery.livequery.js"></script>
<script src="jqueryui-init.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/smoothness/jquery-ui.css" type="text/css" />
<script>
// Register custom widgets. You probably want to do this in a separate js file
$.widget('ui.warning', {
_init: function(){
this.element
.prepend('<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>')
.wrap('<div class="ui-widget"></div>')
.wrap('<div class="ui-state-error ui-corner-all"></div>')
}
})
$.widget('ui.info', {
_init: function(){
this.element
.prepend('<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>')
.wrap('<div class="ui-widget"></div>')
.wrap('<div class="ui-state-highlight ui-corner-all"></div>')
}
})
$(function(){
// When loading html with ajax and have livequery included, you dont need to do anything to initialize the widgets
$.get('example_load.html', function(loaded){
$('#ajax-loaded').html(loaded)
})
})
</script>
</head>
<body>
<h1>Widget examples: </h1>
<p data-ui="warning">Test</p>
<p data-ui="info">Best</p>
<p data-ui="buttonset"><a href="#" data-ui="button" data-ui-button-icons-primary="ui-icon-check">test 1</a><a href="#">test 2</a></p>
<div data-ui="tabs">
<ul>
<li><a href="#tab1">tab1</a></li>
<li><a href="#tab2">tab2</a></li>
<li><a href="#tab3">tab3</a></li>
</ul>
<div id="tab1">t1</div>
<div id="tab2">t2</div>
<div id="tab3">t3</div>
</div>
<div id="ajax-loaded"></div>
<div id="datepicker-container">
<p>Select date</p>
<input data-ui="datepicker" id="datepicker" name="date" type="text"/>
</div>
</body>
</html>