-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
72 lines (59 loc) · 2.19 KB
/
demo.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
<!--
Copyright (c) 2015 Stephan Schmitz, <https://eyecatchup.github.io/>, <[email protected]>. All rights reserved.
This code may only be used under the MIT license found at <http://eyecatchup.mit-license.org/>.
--><!doctype html>
<html ng-app="draggableToggleDemo">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>AngularJS Draggable Toggle Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<!-- Load the toggle button styles -->
<link rel="stylesheet" href="./dist/angular-draggable-toggle.css">
<style>
h3 {
font-size: 21px;
}
.clickme {
max-width: 200px;
font-family: Arial,'Sans serif';
}
</style>
</head>
<body>
<div class="clickme">
<h3>Click here!</h3>
<div rel="clickme" class="toggle toggle-clean"></div>
</div>
<h3>Not clickable, On onload.</h3>
<div class="toggle toggle-clean noclick on"></div>
<h3>Not draggable.</h3>
<div class="toggle toggle-clean nodrag"></div>
<!-- Load jquery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>window.jQuery||document.write('<script src="bower_components/jquery/dist/jquery.min.js"><\/script>');</script>
<!-- Load the toggle button plugin -->
<script src="./dist/angular-draggable-toggle.min.js"></script>
<!-- Configure and initialize the plugin -->
<script>
$('.toggle').each(function() {
$(this).toggles({
animate: 400,
click: !$(this).hasClass('noclick'),
drag: !$(this).hasClass('nodrag'),
clicker: ($(this).attr('rel')) ? $('.'+$(this).attr('rel')) : null,
on: $(this).hasClass('on'),
checkbox: null,
text: {
on: 'AN', // text for the ON position
off: 'AUS' // and off
},
type: 'compact',
handleWidth: 120, // width used if not set in css
height: 30, // height if not set in css
});
});
</script>
</body>
</html>