-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathREADME
More file actions
61 lines (45 loc) · 1.19 KB
/
README
File metadata and controls
61 lines (45 loc) · 1.19 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
/* jangle README
*
* Last modified by: Cory Dorning
* Last modified on: 09/14/11
*
* jAngle is a jQuery plugin that uses CSS3 (or appropriate
* MS filters) to rotate an element using the passed angle
* parameter.
*
*/
Requirements
------------------
To use jangle, it is recommended you use the latest version
of jQuery 1.6. Reference the jQuery library followed the
jangle JavaScript file:
<!-- load jQuery library -->
<script src="/common/js/libs/jquery-1.6.min.js"></script>
<!-- load jangle plugin -->
<script src="jquery-jangle-0.5.js"></script>
Now you are ready to use jangle! Below is some example code on the ways
you can use it.
Page Load
------------------
<!-- rotate a DIV 90 degrees -->
<script>
$('div').jangle(90);
</script>
Click Event
------------------
<!-- rotate a DIV 90 degrees upon clicking a link -->
<script>
$('a').click(function() {
$('div').jangle(90);
});
</script>
Form Driven
------------------
<!-- see jangle-example.html for full code sample -->
<!-- rotate an image based on input value -->
<script>
$('button').click(function() {
var angle = parseInt($('input[type=text]').val()) || 0;
$('img').jangle(angle);
});
</script>