-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
185 lines (141 loc) · 4.74 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>addWidthClass Plugin Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<style>
h3 {
background: #eee;
color: #111;
padding: 0 0.2em;
}
/* following classes will be created automatically by plugin */
h3.width-gt-400{
background: #ccc;
color: #333;
}
h3.width-gt-500{
background: #111;
color: #eee;
}
h3.width-gt-600{
background: #aaa;
color: #fff;
}
/* demo styles */
body {
color: 333;
line-height: 1.4;
font-family: sans-serif;
}
pre {
font: 14px Consolas,"Liberation Mono",Menlo,Courier,monospace;
padding: 16px;
overflow: auto;
line-height: 1.45;
background-color: #F7F7F7;
border-radius: 3px;
}
</style>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<h1>Plugin Demo</h1>
<div style="width: 350px">
<h3>h3 tag 350px width</h3>
</div>
<div style="width: 450px">
<h3>h3 tag 450px width</h3>
</div>
<div style="width: 550px">
<h3>h3 tag 550px width</h3>
</div>
<div style="width: 650px">
<h3>h3 tag 650px width</h3>
</div>
<hr>
<h1>Plugin Documentation</h1>
<p>This plugin adds CSS classes depending from element width
Pass your breakpoints to plugin in pixels and it will automatically add following CSS classes to your elements:</p>
<pre><code>width-lt-xxx
width-gt-xxx
</code></pre>
<p>where 'xxx' is your breakpoint value</p>
<hr>
<h2>
<a id="user-content-plugin-setup" class="anchor" href="#plugin-setup" aria-hidden="true"><span class="octicon octicon-link"></span></a>Plugin Setup</h2>
<h3>
<a id="user-content-1-create-your-markup" class="anchor" href="#1-create-your-markup" aria-hidden="true"><span class="octicon octicon-link"></span></a>1. Create your markup</h3>
<pre><code><div style="width: 350px">
<h3>h3 tag 350px width</h3>
</div>
<div style="width: 450px">
<h3>h3 tag 450px width</h3>
</div>
<div style="width: 550px">
<h3>h3 tag 550px width</h3>
</div>
<div style="width: 650px">
<h3>h3 tag 650px width</h3>
</div>
</code></pre>
<h3>2. Add jQuery and Plugin</h3>
<pre><code><script src="jquery-1.11.2.min.js"></script>
<script src="jquery.addwidthclass.js"></script>
</code></pre>
<h3>3. Initialize your plugin</h3>
<pre><code>jQuery(document).ready(function(){
jQuery('h3').addWidthClass({
breakpoints: [400, 500, 600]
});
});
</code></pre>
<p>If you done right, the result will be:</p>
<pre><code><div style="width: 350px">
<h3 class="width-lt-600 width-lt-500 width-lt-400">h3 tag 350px width</h3>
</div>
<div style="width: 450px">
<h3 class="width-lt-600 width-lt-500 width-gt-400">h3 tag 450px width</h3>
</div>
<div style="width: 550px">
<h3 class="width-lt-600 width-gt-500 width-gt-400">h3 tag 550px width</h3>
</div>
<div style="width: 650px">
<h3 class="width-gt-600 width-gt-500 width-gt-400">h3 tag 650px width</h3>
</div>
</code></pre>
<h3>4. Add your CSS styles</h3>
<pre><code>h3 {
background: #eee;
color: #111;
}
h3.width-gt-400{
background: #ccc;
color: #333;
}
h3.width-gt-500{
background: #111;
color: #eee;
}
h3.width-gt-600{
background: #aaa;
color: #fff;
}
</code></pre>
<script src="jquery-1.11.2.min.js"></script>
<script src="jquery.addwidthclass.js"></script>
<script>
jQuery(document).ready(function(){
jQuery('h3').addWidthClass({
breakpoints: [400, 500, 600]
});
});
</script>
</body>
</html>