forked from tinybigideas/jGravity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (98 loc) · 4.86 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jGravity Demo</title>
<!-- jQuery *Reequired -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<!-- jGravity file -->
<script type="text/javascript" src="jGravity-min.js"></script>
<!-- Unimportant CSS File for demo purposes -->
<link href="http://tinybigideas.com/template/css/colourpadFramework-min.css" rel="stylesheet" />
<script>
$(document).ready(function() {
$('div.jGravity').live('click', function() { // This can be changed to anything you like in order to trigger jGravity effect
$('body').jGravity({ // jGravity works best when targeting the body
target: 'everything', // Enter your target critera e.g. 'div, p, span', 'h2' or 'div#specificDiv', or even 'everything' to target everything in the body
ignoreClass: 'ignoreMe', // Specify if you would like to use an ignore class, and then specify the class
weight: 25, // Enter any number 1-100 ideally (25 is default), you can also use 'heavy' or 'light'
depth: 5, // Enter a value between 1-10 ideally (1 is default), this is used to prevent targeting structural divs or other items which may break layout in jGravity
drag: true // Decide if users can drag elements which have been effected by jGravity
});
// Misc code for demo purposes
$(this).removeClass('jGravity');
$(this).delay(1000).queue(function() {
$(this).html("<h2><a href='http://tinybigideas.com/plugins/jquery-gravity/'>Get jGravity</a></h2>");
});
// ----- \\
});
});
</script>
<style>
/* Misc styles used for demo purposes */
body {overflow:hidden; margin:0; padding:0; height:100%;}
div.box {height:100px; width:100px; float:left; margin:10px; color:white; text-align:center;}
div.blackHeader {width:100%; clear:both; height:30px;}
div.blackHeader div.headPiece {background:#333; width:5%; float:left; height:30px;}
div.blackHeader div.headPiece p {color: white;text-align: center;padding-top: 5px;}
div.blackHeader div.headPiece p a {color: white;text-decoration: none;}
div.logoBar {width:100%; clear:both; height:70px;}
div.logoBar div.barPiece {background:#F1F1F1; width:20%; height:70px; border-bottom:1px solid #E2E2E2; float:left;}
div.logoBar h1 {color:#333; text-align:center; font-size:30px; padding-top:12px; font-weight:normal;}
div.logoBar h1 a {color: #333; padding-bottom: 2px;}
div.goBtnCentre {width:100%; clear:both; height: 80px; margin:20px 0;}
div.goButton {height: 80px; background: #E7534A;border: 1px solid #CE2117;width:200px; margin:0 auto;}
div.goButton h2 {text-align: center;font-size: 25px;color: white;font-weight: normal;line-height: 80px;cursor: pointer;}
div.goButton h2 a {color: white;}
div.duckCentre {width:100%; clear:both; height: 500px; margin:20px 0;}
div.duckCentre div.duckInner {width:740px; margin:0 auto;}
div.duckCentre div.duck {background:#FFF; float:left; width:200px; height:200px; margin:10px; padding:10px; border:1px solid #eee;}
</style>
</head>
<body>
<!-- All HTML elements are used for demo purposes - jGravity should work correctly on most layouts. If you do find a problem item/s, play with the depth and ignoring certain items until you get it right -->
<div class="blackHeader ignoreMe">
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
<div class="headPiece"></div>
</div>
<div class="logoBar ignoreMe">
<div class="barPiece"></div>
<div class="barPiece"></div>
<div class="barPiece">
<h1 class="ignoreMe"><a class="ignoreMe" href="http://tinybigideas.com">tiny<strong class="ignoreMe">BIG</strong>ideas</a></h1>
</div>
<div class="barPiece"></div>
<div class="barPiece"></div>
</div>
<div class="goBtnCentre ignoreMe">
<div class="goButton jGravity">
<h2 class="ignoreMe">Initiate jGravity</h2>
</div>
</div>
<div class="duckCentre ignoreMe">
<div class="duckInner ignoreMe">
<div class="duck"><img class="ignoreMe" src="img/duck1.jpg" /></div>
<div class="duck"><img class="ignoreMe" src="img/duck2.jpg" /></div>
<div class="duck"><img class="ignoreMe" src="img/duck3.jpg" /></div>
</div>
</div>
</body>
</html>