fix typo
[openemr.git] / public / assets / AnythingSlider-1-9-4 / demos.html
blob10614a7330e6f559fee6e9dc8f029bf4d5bfdd41
1 <!DOCTYPE html>
2 <html>
4 <head>
5 <meta charset="utf-8">
7 <title>AnythingSlider FX Demos</title>
8 <link rel="shortcut icon" href="demos/images/favicon.ico" type="image/x-icon">
9 <link rel="apple-touch-icon" href="demos/images/apple-touch-icon.png">
11 <!-- Syntax highlighting -->
12 <link rel="stylesheet" href="demos/prettify/prettify.css" media="screen">
13 <script src="demos/prettify/prettify.js"></script>
15 <!-- jQuery (required) & jQuery UI (for this demo only) -->
16 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
17 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
18 <script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
19 <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
21 <!-- Anything Slider optional plugins -->
22 <script src="js/jquery.easing.1.2.js"></script>
24 <!-- Anything Slider -->
25 <link rel="stylesheet" href="css/anythingslider.css">
26 <script src="js/jquery.anythingslider.js"></script>
28 <!-- Ideally, add the stylesheet(s) you are going to use here,
29 otherwise they are loaded and appended to the <head> automatically and will over-ride the IE stylesheet below -->
30 <link rel="stylesheet" href="css/theme-metallic.css" media="screen">
32 <!-- AnythingSlider optional FX extension -->
33 <script src="js/jquery.anythingslider.fx.js"></script>
35 <!-- Demos page only -->
36 <link rel="stylesheet" href="demos/css/page.css">
37 <link rel="stylesheet" href="demos/colorbox/colorbox.css">
38 <script src="demos/js/demo.js"></script>
39 <script src="demos/colorbox/jquery.colorbox-min.js"></script>
42 </head>
44 <body>
46 <div id="demo2">
48 <div id="nav">
49 <a href="index.html">Main Demo</a>
50 <a href="simple.html">Simple Demo</a>
51 <a href="expand.html">Expand Demo</a>
52 <a href="video.html">Video Demo</a>
53 <a class="current" href="demos.html">FX Demos</a>
54 <a href="css3.html">CSS3 Demo</a>
55 <a class="play" href="http://jsfiddle.net/Mottie/ycUB6/">Playground</a>
56 <a class="git" href="https://github.com/CSS-Tricks/AnythingSlider/wiki">Documentation</a>
57 <a class="git" href="https://github.com/CSS-Tricks/AnythingSlider/zipball/master">Download</a>
58 <a class="issue" href="https://github.com/CSS-Tricks/AnythingSlider/issues">Issues</a>
59 </div>
61 <h1>AnythingSlider FX Demos</h1>
63 <h2 class="title">Demo 1: Thumbnails &amp; A Lightbox</h2>
65 <!-- AnythingSlider #1 -->
66 <ul id="slider1">
67 <li><img src="demos/images/slide-civil-1.jpg" alt="" title="In Soviet Russia, concrete pours you!"></li>
68 <li><img src="demos/images/slide-env-1.jpg" alt="" title="How many supervisors are there? Wrong! 5, who is taking the picture?"></li>
69 <li><img src="demos/images/slide-civil-2.jpg" alt="" title="Alas, the pylon would never make it to the hydrant, her true love."></li>
70 <li><img src="demos/images/slide-env-2.jpg" alt="" title="Take a left at the traffic circle."></li>
71 </ul>
72 <!-- END AnythingSlider #1 -->
73 <br />
75 <div class="accordion">
76 <h3><a href="#">Demo 1 Notes</a></h3>
77 <div>
78 <ul>
79 <li>Hover over the demo 1 slider to reveal the thumbnail navigation links - This sliding feature is part of the core AnythingSlider plugin (<code>toggleControls</code> is set to true).</li>
80 <li>Thumbnail images<br /><br />
81 <ul>
82 <li>For this demo, the thumbnail images are premade; but with some server side scripting and modification to the <code>navigationFormatter</code> code, you should be able to create and link to your own thumbnail images.</li>
83 <li>CSS is required to override the metallic theme CSS for thumbnail images to be visible (resize and remove negative text indentation), or you can make a new theme.</li>
84 <li>Add images using the <code>navigationFormatter</code> option as follows:<br /><br />
85 <pre class="prettyprint lang-javascript"> navigationFormatter : function(i, panel){
86 return '&lt;img src="demos/images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i-1] + '.jpg"&gt;';
87 }</pre>
88 </li>
89 </ul>
90 </li>
91 <li>Lightbox Popup (<a href="http://colorpowered.com/colorbox/">Colorbox</a> plugin)<br /><br />
92 <ul>
93 <li>Click on the current slider image to open a light box. Press escape or click on the (X) in the lower right corner to close it.</li>
94 <li>Additional CSS is required to modify the Colorbox plugin. The CSS expands the image to completely fill the inside the colorbox popup. Adjust as desired to keep the image proportional.</li>
95 <li>The script attaches a colorbox popup to all images inside the slider. Add a class to the images to modify this behaviour.</li>
96 <li>The colorbox popup will contain all the current slider images. In the script the name "group" is added to all images in the "rel" attribute. This can be done in the HTML to target only the images to be shown in the colorbox - then remove the <code>.attr('rel','group')</code> in the script.</li>
97 </ul>
98 </li>
99 <li>The AnythingSlider FX extension is not required to add any of the above functionality.</li>
100 </ul>
101 </div>
103 <h3><a href="#">Header</a></h3>
104 <div>
105 <pre class="prettyprint lang-html"> &lt;!-- jQuery --&gt;
106 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js&quot;&gt;&lt;/script&gt;
108 &lt;!-- Anything Slider optional plugins --&gt;
109 &lt;script src=&quot;js/jquery.easing.1.2.js&quot;&gt;&lt;/script&gt;
111 &lt;!-- Anything Slider --&gt;
112 &lt;link href=&quot;css/anythingslider.css&quot; rel=&quot;stylesheet&quot;&gt;
113 &lt;script src=&quot;js/jquery.anythingslider.min.js&quot;&gt;&lt;/script&gt;
115 &lt;!-- ColorBox --&gt;
116 &lt;link href=&quot;demos/colorbox/colorbox.css&quot; rel=&quot;stylesheet&quot;&gt;
117 &lt;script src=&quot;demos/colorbox/jquery.colorbox-min.js&quot;&gt;&lt;/script&gt;</pre>
118 </div>
120 <h3><a href="#">CSS &amp; HTML</a></h3>
121 <div>
122 <pre class="prettyprint lang-css"> /* New in version 1.7+ */
123 #slider1 {
124 width: 400px;
125 height: 300px;
126 list-style: none;
128 /* CSS to expand the image to fit inside colorbox */
129 #cboxPhoto { width: 100%; height: 100%; margin: 0 !important; }
130 /* Change metallic theme defaults to show thumbnails */
131 div.anythingControls {
132 bottom: 25px; /* thumbnail images are larger than the original bullets; move it up */
134 .anythingSlider-metallic .thumbNav a {
135 background-image: url();
136 height: 30px;
137 width: 30px;
138 border: #000 1px solid;
139 border-radius: 2px;
140 -moz-border-radius: 2px;
141 -webkit-border-radius: 2px;
142 text-indent: 0;
144 .anythingSlider-metallic .thumbNav a span {
145 visibility: visible; /* span changed to visibility hidden in v1.7.20 */
147 /* border around link (image) to show current panel */
148 .anythingSlider-metallic .thumbNav a:hover,
149 .anythingSlider-metallic .thumbNav a.cur {
150 border-color: #fff;
152 /* reposition the start/stop button */
153 .anythingSlider-metallic .start-stop {
154 margin-top: 15px;
155 }</pre>
156 <br>
157 <pre class="prettyprint lang-html">&lt;ul id=&quot;slider1&quot;&gt;
158 &lt;li&gt;&lt;img src=&quot;demos/images/slide-civil-1.jpg&quot;&gt;&lt;/li&gt;
159 &lt;li&gt;&lt;img src=&quot;demos/images/slide-env-1.jpg&quot;&gt;&lt;/li&gt;
160 &lt;li&gt;&lt;img src=&quot;demos/images/slide-civil-2.jpg&quot;&gt;&lt;/li&gt;
161 &lt;li&gt;&lt;img src=&quot;demos/images/slide-env-2.jpg&quot;&gt;&lt;/li&gt;
162 &lt;/ul&gt;</pre>
163 </div>
165 <h3><a href="#">Script</a></h3>
166 <div><pre class="prettyprint lang-javascript">$(function(){
167 $('#slider1')
168 .anythingSlider({
169 toggleControls : true,
170 theme : 'metallic',
171 navigationFormatter : function(i, panel){ // add thumbnails as navigation links
172 return '&lt;img src="demos/images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg"&gt;';
175 // target all images inside the current slider
176 // replace with 'img.someclass' to target specific images
177 .find('.panel:not(.cloned) img') // ignore the cloned panels
178 .attr('rel','group') // add all slider images to a colorbox group
179 .colorbox({
180 width: '90%',
181 height: '90%',
182 href: function(){ return $(this).attr('src'); },
183 // use $(this).attr('title') for specific image captions
184 title: 'Press escape to close',
185 rel: 'group'
187 });</pre>
188 </div>
189 </div>
191 <br><br>
193 <h2 class="title">Demo 2: FX Extension Panel Effects</h2>
195 <!-- AnythingSlider #2 -->
196 <ul id="slider2">
197 <li class="panel1">
198 <div>
199 <div class="textSlide">
200 <img src="demos/images/251356.jpg" alt="tomato sandwich" style="float: right; margin: 0 0 2px 10px;" />
201 <h3>Queenie's Killer Tomato Bagel Sandwich</h3>
202 <h4>Ingredients</h4>
203 <ul>
204 <li>1 bagel, split and toasted</li>
205 <li>2 tablespoons cream cheese</li>
206 <li>1 roma (plum) tomatoes, thinly sliced</li>
207 <li>salt and pepper to taste</li>
208 <li>4 leaves fresh basil</li>
209 </ul>
210 </div>
211 </div>
212 </li>
213 <li class="panel2">
214 <div class="quoteSlide">
215 <blockquote>In awe I watched the waxing moon ride across the zenith of the heavens like an ambered chariot towards the ebon void of infinite space wherein the tethered belts of Jupiter and Mars hang forever festooned in their orbital majesty. And as I looked at all this I thought... I must put a roof on this lavatory.<p>~ Les Dawson</p></blockquote>
216 </div>
217 </li>
218 <li class="panel3">
219 <img class="expand" src="demos/images/slide-tele-1.jpg" alt="" />
220 </li>
221 <li class="panel4" id="quote2">
222 <div class="quoteSlide">
223 <blockquote>Life is conversational. Web design should be the same way. On the web, you&#8217;re talking to someone you&#8217;ve probably never met – so it&#8217;s important to be clear and precise. Thus, well structured navigation and content organization goes hand in hand with having a good conversation.</blockquote>
224 <p> - <a id='perma' href='http://quotesondesign.com/chikezie-ejiasi/'>Chikezie Ejiasi</a></p>
225 </div>
226 </li>
227 <li class="panel5">
228 <img class="fade" src="demos/images/slide-tele-2.jpg" alt="" />
229 </li>
230 </ul>
231 <!-- END AnythingSlider #2 -->
233 <br>
235 <div class="accordion">
237 <h3><a href="#">Demo 2 Notes</a></h3>
238 <div>
239 <ul>
240 <li>The AnythingSlider FX extension is required to add this functionality.</li>
241 <li>No additional CSS is required, unless it is used for a specific element (see the captions section).</li>
242 <li>Effects Methods:<br><br>
243 <ul>
244 <li>The effects are set up so that the slider element on each panel is in its default (final) position in the "inFx" definition (element positions to zero, opacity to 1, etc) and the "outFX" definitions are set the other position the element is in to achieve the animation.</li>
245 <li>The script binds to the "slide_init" (for "outFx" animation) and "slide_complete" (for "inFx" animation) anythingSlider events.</li>
246 <li>The base effects are predefined shortcut methods. I have included the custom effect equivalents to these base effects in the script examples.</li>
247 </ul>
248 </li>
249 <li>Base effects:<br><br>
250 <ul>
251 <li>Base effects are standard effects: <code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>, <code>fade</code>, <code>expand</code>, <code>listLR</code>, <code>listRL</code>, <code>caption-Top</code>, <code>caption-Right</code>, <code>caption-Bottom</code>, <code>caption-Left</code>.</li>
252 <li>Use the base effects as follows:<br><br>
253 <pre class="prettyprint lang-javascript"> $('#slider2').anythingSliderFx({
254 '.selector1' : [ 'effect(s)', 'size', 'time', 'easing' ],
255 '.selector2' : [ 'effect(s)', 'size', 'time', 'easing' ]
256 });</pre>
257 'size', 'time' and 'easing' are optional, but they must remain in that order. So if you want to add an effect time, you must also set a size - <code>[ 'effect(s)', 'size', 'time' ]</code>. To add an easing, all parameters must be included.</li>
258 <li>Defaults: If 'size', 'time' or 'easing' is not defined, it will be set to its default value:<br><br>
259 <ul>
260 <li>size : based on initial slider height and width</li>
261 <li>'inFx' time : 400 (ms)</li>
262 <li>'outFx' time : 350 (ms)</li>
263 <li>easing : 'swing'</li>
264 </ul>
265 </li>
266 <li>How base effects are setup:<br><br>
267 <ul>
268 <li><code>top</code>, <code>bottom</code>, <code>left</code>, <code>right</code>: Default 'inFx' position is zero, 'outFx' position is based on the initial slider height and width.</li>
269 <li><code>fade</code>: Default 'inFx' has an opacity set to one, 'outFx' opacity is zero.</li>
270 <li><code>expand</code>: Default 'inFx' sets the width to 100%, left and right positions to 0%; the 'outFx' width is set to 10%, left and right set to 50% to somewhat center the image. When changing this size option, use percentage values, but anything more than 20% the image position will noticeably be not centered.</li>
271 <li><code>listLR</code>: Default 'inFx' left position is zero; 'outFx' position will make ':odd' elements move (L)eft and ':even' elements move (R)ight the width of the slider.</li>
272 <li><code>listRL</code>: Default 'inFx' left position is zero; 'outFx' position will make ':odd' elements move (R)ight and ':even' elements move (L)eft the width of the slider.</li>
273 <li><code>caption-{direction}</code>: This effect is opposite of the others. The default 'inFx' positions the element so it is in view while the 'outFx' positions the element out of view. See demo 3 for more details.</li>
274 </ul>
275 </li>
276 <li>Combine any of these standard effects as desired (e.g. "top fade"); but of course, using 'top bottom' will not work as you expect (unless you wanted to blow up your computer ;) LOL).</li>
277 </ul>
278 </li>
279 <li>Custom effects:<br><br>
280 <ul>
281 <li>Custom effects allow you to use any of the standard jQuery animation parameters (e.g. top, left, margin, padding, width, height, etc). See the examples below.</li>
282 <li>Custom effects can be mixed in with base effects as desired.</li>
283 <li>When using custom effects it is important that each element with an 'inFx' method has a matching 'outFx' method, or those elements will be abnormally positioned and/or disappear from view.</li>
284 <li>Standard setup for custom effects is as follows (there is no specific order required):<br><br>
285 <pre class="prettyprint lang-javascript"> $('#slider1').anythingSliderFx({
286 inFx : {
287 '.selector1' : { top : 0, duration: 400, easing : 'easeOutBounce' },
288 '.selector2' : { left: 0, duration: 400 }
290 // out = the animation that occurs when you slide "out" of a panel
291 // (it also occurs before the "in" animation)
292 outFx : {
293 '.selector1' : { top : '-100px', duration: 350 },
294 '.selector2' : { left : '-200px' }
295 }</pre></li>
296 <li>Defaults: if 'time' or 'easing' is not defined in the custom effects code, it will be set to its default value:<br><br>
297 <ul>
298 <li>'inFx' time : 400 (ms)</li>
299 <li>'outFx' time : 350 (ms)</li>
300 <li>easing : 'swing'</li>
301 </ul>
302 </li>
303 </ul>
304 </li>
305 </ul>
306 </div>
308 <h3><a href="#">Header</a></h3>
309 <div>
310 <pre class="prettyprint lang-html">&lt;!-- jQuery --&gt;
311 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js&quot;&gt;&lt;/script&gt;
313 &lt;!-- Anything Slider optional plugins --&gt;
314 &lt;script src=&quot;js/jquery.easing.1.2.js&quot;&gt;&lt;/script&gt;
316 &lt;!-- Anything Slider --&gt;
317 &lt;link href=&quot;css/anythingslider.css&quot; rel=&quot;stylesheet&quot;&gt;
318 &lt;script src=&quot;js/jquery.anythingslider.min.js&quot;&gt;&lt;/script&gt;
320 &lt;!-- Anything Slider optional FX extension --&gt;
321 &lt;script src=&quot;js/jquery.anythingslider.fx.min.js&quot;&gt;&lt;/script&gt;</pre>
322 </div>
324 <h3><a href="#">CSS &amp; HTML</a></h3>
325 <div><pre class="prettyprint lang-css">/* New in version 1.7+ */
326 #slider2 {
327 width: 600px;
328 height: 350px;
329 list-style: none;
330 }</pre>
331 There is no change from the standard HTML setup, unless you want to add more specific classes so you can target them with effects.<br><br>
332 <pre class="prettyprint lang-html">&lt;ul id=&quot;slider2&quot;&gt;
333 &lt;li class=&quot;panel1&quot;&gt;
334 &lt;div class=&quot;textSlide&quot;&gt;
335 &lt;img src=&quot;demos/images/251356.jpg&quot; alt=&quot;tomato sandwich&quot; style=&quot;float: right;
336 margin: 0 0 2px 10px;&quot;&gt;
337 &lt;h3&gt;Queenie's Killer Tomato Bagel Sandwich&lt;/h3&gt;
338 &lt;h4&gt;Ingredients&lt;/h4&gt;
339 &lt;ul&gt;
340 &lt;li&gt;1 bagel, split and toasted&lt;/li&gt;
341 &lt;li&gt;2 tablespoons cream cheese&lt;/li&gt;
342 &lt;li&gt;1 roma (plum) tomatoes, thinly sliced&lt;/li&gt;
343 &lt;li&gt;salt and pepper to taste&lt;/li&gt;
344 &lt;li&gt;4 leaves fresh basil&lt;/li&gt;
345 &lt;/ul&gt;
346 &lt;/div&gt;
347 &lt;/li&gt;
348 &lt;li class=&quot;panel2&quot;&gt;
349 &lt;div class=&quot;quoteSlide&quot;&gt;
350 &lt;blockquote&gt;In awe I watched the waxing moon ride across the zenith of
351 the heavens like an ambered chariot towards the ebon void of infinite space
352 wherein the tethered belts of Jupiter and Mars hang forever festooned in
353 their orbital majesty. And as I looked at all this I thought... I must put
354 a roof on this lavatory.&lt;br&gt;-- Les Dawson&lt;/blockquote&gt;
355 &lt;/div&gt;
356 &lt;/li&gt;
357 &lt;li class=&quot;panel3&quot;&gt;
358 &lt;img class=&quot;expand&quot; src=&quot;demos/images/slide-tele-1.jpg&quot; alt=&quot;&quot;&gt;
359 &lt;/li&gt;
360 &lt;li class=&quot;panel4&quot;&gt;
361 &lt;div class=&quot;quoteSlide&quot;&gt;
362 &lt;blockquote&gt;Life is conversational. Web design should be the same way.
363 On the web, you&amp;#8217;re talking to someone you&amp;#8217;ve probably
364 never met &#x2013; so it&amp;#8217;s important to be clear and precise.
365 Thus, well structured navigation and content organization goes hand in hand
366 with having a good conversation.&lt;/blockquote&gt;
367 &lt;p&gt;
368 - &lt;a href='http://quotesondesign.com/chikezie-ejiasi/'&gt;Chikezie Ejiasi&lt;/a&gt;
369 &lt;/p&gt;
370 &lt;/div&gt;
371 &lt;/li&gt;
372 &lt;li class=&quot;panel5&quot;&gt;
373 &lt;img class=&quot;fade&quot; src=&quot;demos/images/slide-tele-2.jpg&quot; alt=&quot;&quot;&gt;
374 &lt;/li&gt;
375 &lt;/ul&gt;</pre>
376 </div>
378 <h3><a href="#">Script - FX addon, using base FX</a></h3>
379 <div><pre class="prettyprint lang-javascript">$(function(){
380 $('#slider2') // Demo 2 code, using FX base effects
381 .anythingSlider({
382 resizeContents : false,
383 navigationFormatter : function(i, panel){
384 return ['Recipe', 'Quote', 'Image', 'Quote #2', 'Image #2', 'Test'][i - 1];
387 .anythingSliderFx({
388 // base FX definitions
389 // '.selector' : [ 'effect(s)', 'size', 'time', 'easing' ]
390 // 'size', 'time' and 'easing' are optional parameters, but must be kept in order if added
391 '.quoteSlide:first > *' : [ 'grow', '24px', '400', 'easeInOutCirc' ],
392 '.quoteSlide:last' : [ 'top', '500px', '400', 'easeOutElastic' ],
393 '.expand' : [ 'expand', '10%', '400', 'easeOutBounce' ],
394 '.textSlide h3' : [ 'top fade', '200px', '500', 'easeOutBounce' ],
395 '.textSlide img,.fade' : [ 'fade' ],
396 '.textSlide li' : [ 'listLR' ]
398 });</pre>
399 * Note: Each definition should end with a comma except for the last - see examples above.
400 </div>
402 <h3><a href="#">Script - FX addon, using custom FX</a></h3>
403 <div><pre class="prettyprint lang-javascript">$(function(){
404 $('#slider2') // Demo 2 code, using FX full control
405 .anythingSlider({
406 resizeContents : false,
407 navigationFormatter : function(i, panel){
408 return ['Recipe', 'Quote', 'Image', 'Quote #2', 'Image #2', 'Test'][i - 1];
411 .anythingSliderFx({
412 // base FX definitions can be mixed and matched in here too.
413 '.fade' : [ 'fade' ],
415 // for more precise control, use the "inFx" and "outFx" definitions
416 // inFx = the animation that occurs when you slide "in" to a panel
417 inFx : {
418 '.textSlide h3' : { opacity: 1, top : 0, duration: 400, easing : 'easeOutBounce' },
419 '.textSlide li' : { opacity: 1, left : 0, duration: 400 },
420 '.textSlide img' : { opacity: 1, duration: 400 },
421 '.quoteSlide' : { top : 0, duration: 400, easing : 'easeOutElastic' },
422 '.expand' : { width: '100%', top: '0%', left: '0%', duration: 400, easing : 'easeOutBounce' }
424 // out = the animation that occurs when you slide "out" of a panel
425 // (it also occurs before the "in" animation)
426 outFx : {
427 '.textSlide h3' : { opacity: 0, top : '-100px', duration: 350 },
428 '.textSlide li:odd' : { opacity: 0, left : '-200px', duration: 350 },
429 '.textSlide li:even' : { opacity: 0, left : '200px', duration: 350 },
430 '.textSlide img' : { opacity: 0, duration: 350 },
431 '.quoteSlide:first' : { top : '-500px', duration: 350 },
432 '.quoteSlide:last' : { top : '500px', duration: 350 },
433 '.expand' : { width: '10%', top: '50%', left: '50%', duration: 350 }
436 });</pre>
437 * Note: Each definition should end with a comma except for the last - see examples above.
438 </div>
439 </div>
441 <br><br>
442 <h2 class="title">Demo 3: Sliding Captions</h2>
444 <!-- AnythingSlider #3 -->
445 <ul id="slider3">
446 <li class="panel1">
447 <!-- Note this caption is before the image, all others it is after -->
448 <div class="caption-top">In Soviet Russia, concrete pours you!</div>
449 <img src="demos/images/slide-civil-1.jpg" alt="" />
450 </li>
451 <li class="panel2">
452 <img src="demos/images/slide-env-1.jpg" alt="" />
453 <div class="caption-right">How many supervisors are there? Wrong! 5, who is taking the picture?</div>
454 </li>
455 <li class="panel3">
456 <img src="demos/images/slide-civil-2.jpg" alt="" />
457 <div class="caption-bottom">Alas, the pylon would never make it to the hydrant, her true love.</div>
458 </li>
459 <li class="panel4">
460 <img src="demos/images/slide-env-2.jpg" alt="" />
461 <div class="caption-left">Take a left at the traffic circle.</div>
462 </li>
463 </ul>
464 <!-- END AnythingSlider #3 -->
466 <br>
468 <div class="accordion">
470 <h3><a href="#">Demo 3 Notes</a></h3>
471 <div>
472 <ul>
473 <li>CSS<br><br>
474 <ul>
475 <li>The image needs to be set to 100% height and width because AnythingSlider will only automatically expand solitary objects; but here we have a caption!</li>
476 <li>Note the caption widths &amp; heights include the padding, so for example the top &amp; bottom caption height is set to 30px instead of 50px to include the 10px padding... same goes for the height of all the captions.</li>
477 <li>If you are using the close button script, make sure you use the full width and/or height (include padding) as well.</li>
478 </ul>
479 </li>
480 <li>In the HTML, note that the top caption comes before the image; whereas the bottom, left and right caption HTML comes after.</li>
481 <li>Script<br><br>
482 <ul>
483 <li>Hover to show caption<br><br>
484 <ul>
485 <li>This code will reveal a caption when hovering over a slider panel, and hide on mouse out.</li>
486 <li>There is a lot of extra code, for captions in multiple positions, so ideally remove the unused portions to maximize the efficiency of the code.</li>
487 <li>This script does not need the AnythingSlider FX extension.</li>
488 </ul>
489 </li>
490 <li>Slide in caption on new panel<br><br>
491 <ul>
492 <li>This code reveals a caption when a new panel comes into view.</li>
493 <li>Code examples are included below to show and reveal captions using base and custom FX. These code examples reveal the caption when the panel comes into view and hide it as it scrolls out of view.</li>
494 <li>A short additional script adds a close button (x) to each caption to allow closing the caption while on a specific panel. CSS to position the button is needed and included.</li>
495 </ul>
496 </li>
497 <li>The script needs to hide the caption when out of view (especially for right and left captions) otherwise they interfere with other panels of the slider.</li>
498 </ul>
499 </li>
500 </ul>
501 </div>
503 <h3><a href="#">Header</a></h3>
504 <div>
505 <pre class="prettyprint lang-html"> &lt;!-- jQuery --&gt;
506 &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js&quot;&gt;&lt;/script&gt;
508 &lt;!-- Anything Slider optional plugins --&gt;
509 &lt;script src=&quot;js/jquery.easing.1.2.js&quot;&gt;&lt;/script&gt;
511 &lt;!-- Anything Slider --&gt;
512 &lt;link href=&quot;css/anythingslider.css&quot; rel=&quot;stylesheet&quot;&gt;
513 &lt;script src=&quot;js/jquery.anythingslider.min.js&quot;&gt;&lt;/script&gt;
515 &lt;!-- Anything Slider optional FX extension --&gt;
516 &lt;script src=&quot;js/jquery.anythingslider.fx.min.js&quot;&gt;&lt;/script&gt;</pre>
517 </div>
519 <h3><a href="#">CSS</a></h3>
520 <div><pre class="prettyprint lang-css">/* New in version 1.7+ */
521 #slider3 {
522 width: 500px;
523 height: 400px;
524 list-style: none;
526 /* images with caption */
527 #slider3 img {
528 width: 100%;
529 height: 100%;
531 /* position the panels so the captions appear correctly */
532 #slider3 .panel { position: relative; }
533 /* captions */
534 #slider3 .caption-top, #slider3 .caption-right,
535 #slider3 .caption-bottom, #slider3 .caption-left {
536 background: #000;
537 color: #fff;
538 padding: 10px;
539 margin: 0;
540 position: relative;
541 z-index: 10;
542 opacity: .8;
543 filter: alpha(opacity=80);
545 /* Top caption - padding is included in the width (480px here, 500px in the script), same for height */
546 #slider3 .caption-top {
547 left: 0;
548 top: 0;
549 width: 480px;
550 height: 30px;
552 /* Right caption - padding is included in the width (130px here, 150px in the script), same for height */
553 #slider3 .caption-right {
554 right: 0;
555 bottom: 0;
556 width: 130px;
557 height: 180px;
559 /* Bottom caption - padding is included in the width (480px here, 500px in the script), same for height */
560 #slider3 .caption-bottom {
561 left: 0;
562 bottom: 0;
563 width: 480px;
564 height: 30px;
566 /* Left caption - padding is included in the width (130px here, 150px in the script), same for height */
567 #slider3 .caption-left {
568 left: 0;
569 bottom: 0;
570 width: 130px;
571 height: 180px;
573 /* Caption close button */
574 .caption-top .close, .caption-right .close,
575 .caption-bottom .close, .caption-left .close {
576 font-size: 80%;
577 cursor: pointer;
578 float: right;
579 display: inline-block;
580 }</pre>
581 </div>
583 <h3><a href="#">HTML</a></h3>
584 <div><pre class="prettyprint lang-html"> &lt;ul id=&quot;slider3&quot;&gt;
585 &lt;li&gt;
586 &lt;!-- Note this caption is before the image, all others it is after --&gt;
587 &lt;div class=&quot;caption-top&quot;&gt;
588 In Soviet Russia, concrete pours you!
589 &lt;/div&gt;
590 &lt;img src=&quot;demos/images/slide-civil-1.jpg&quot; alt=&quot;&quot;&gt;
591 &lt;/li&gt;
592 &lt;li&gt;
593 &lt;img src=&quot;demos/images/slide-env-1.jpg&quot; alt=&quot;&quot;&gt;
594 &lt;div class=&quot;caption-right&quot;&gt;
595 How many supervisors are there? Wrong! 5, who is taking the picture?
596 &lt;/div&gt;
597 &lt;/li&gt;
598 &lt;li&gt;
599 &lt;img src=&quot;demos/images/slide-civil-2.jpg&quot; alt=&quot;&quot;&gt;
600 &lt;div class=&quot;caption-bottom&quot;&gt;
601 Alas, the pylon would never make it to the hydrant, her true love.
602 &lt;/div&gt;
603 &lt;/li&gt;
604 &lt;li&gt;
605 &lt;img src=&quot;demos/images/slide-env-2.jpg&quot; alt=&quot;&quot;&gt;
606 &lt;div class=&quot;caption-left&quot;&gt;
607 Take a left at the traffic circle.
608 &lt;/div&gt;
609 &lt;/li&gt;
610 &lt;/ul&gt;</pre>
611 </div>
613 <h3><a href="#">Script - Caption appears on hover (FX extension not required)</a></h3>
614 <div><pre class="prettyprint lang-javascript">$(function(){
615 $('#slider3')
616 .anythingSlider()
617 /* this code will make the caption appear when you hover over the panel
618 remove the extra statements if you don't have captions in that location */
619 .find('.panel')
620 .find('div[class*=caption]').css({ position: 'absolute' }).end()
621 .hover(function(){ showCaptions( $(this) ) }, function(){ hideCaptions( $(this) ); });
623 showCaptions = function(el){
624 var $this = el;
625 if ($this.find('.caption-top').length) {
626 $this.find('.caption-top')
627 .show()
628 .animate({ top: 0, opacity: 1 }, 400);
630 if ($this.find('.caption-right').length) {
631 $this.find('.caption-right')
632 .show()
633 .animate({ right: 0, opacity: 1 }, 400);
635 if ($this.find('.caption-bottom').length) {
636 $this.find('.caption-bottom')
637 .show()
638 .animate({ bottom: 0, opacity: 1 }, 400);
640 if ($this.find('.caption-left').length) {
641 $this.find('.caption-left')
642 .show()
643 .animate({ left: 0, opacity: 1 }, 400);
646 hideCaptions = function(el){
647 var $this = el;
648 if ($this.find('.caption-top').length) {
649 $this.find('.caption-top')
650 .stop()
651 .animate({ top: -50, opacity: 0 }, 350, function(){
652 $this.find('.caption-top').hide(); });
654 if ($this.find('.caption-right').length) {
655 $this.find('.caption-right')
656 .stop()
657 .animate({ right: -150, opacity: 0 }, 350, function(){
658 $this.find('.caption-right').hide(); });
660 if ($this.find('.caption-bottom').length) {
661 $this.find('.caption-bottom')
662 .stop()
663 .animate({ bottom: -50, opacity: 0 }, 350, function(){
664 $this.find('.caption-bottom').hide(); });
666 if ($this.find('.caption-left').length) {
667 $this.find('.caption-left')
668 .stop()
669 .animate({ left: -150, opacity: 0 }, 350, function(){
670 $this.find('.caption-left').hide(); });
674 // hide all captions initially
675 hideCaptions( $('#slider3 .panel') );
676 });</pre>
677 </div>
679 <h3><a href="#">Script - FX addon, using base FX</a></h3>
680 <div><pre class="prettyprint lang-javascript">$(function(){
681 $('#slider3')
682 .anythingSlider()
683 .anythingSliderFx({
684 // '.selector' : [ 'caption', 'distance/size', 'time', 'easing' ]
685 // 'distance/size', 'time' and 'easing' are optional parameters
686 '.caption-top' : [ 'caption-Top', '50px' ],
687 '.caption-right' : [ 'caption-Right', '130px', '1000', 'easeOutBounce' ],
688 '.caption-bottom' : [ 'caption-Bottom', '50px' ],
689 '.caption-left' : [ 'caption-Left', '130px', '1000', 'easeOutBounce' ]
691 /* add a close button (x) to the caption */
692 .find('div[class*=caption]')
693 .css({ position: 'absolute' })
694 .prepend('&lt;span class="close"&gt;x&lt;/span&gt;')
695 .find('.close').click(function(){
696 var cap = $(this).parent(),
697 ani = { bottom : -50 }; // bottom
698 if (cap.is('.caption-top')) { ani = { top: -50 }; }
699 if (cap.is('.caption-left')) { ani = { left: -150 }; }
700 if (cap.is('.caption-right')) { ani = { right: -150 }; }
701 cap.animate(ani, 400, function(){ cap.hide(); } );
703 });</pre>
704 </div>
706 <h3><a href="#">Script - FX addon, using custom FX</a></h3>
707 <div><pre class="prettyprint lang-javascript">$(function(){
708 $('#slider3')
709 .anythingSlider()
710 /* this "custom" code is the equivalent of the base caption functions */
711 .anythingSliderFx({
712 inFx: {
713 '.caption-top' : { top: 0, opacity: 0.8, duration: 400 },
714 '.caption-right' : { right: 0, opacity: 0.8, duration: 400 },
715 '.caption-bottom' : { bottom: 0, opacity: 0.8, duration: 400 },
716 '.caption-left' : { left: 0, opacity: 0.8, duration: 400 }
718 outFx: {
719 '.caption-top' : { top: -50, opacity: 0, duration: 350 },
720 '.caption-right' : { right: -150, opacity: 0, duration: 350 },
721 '.caption-bottom' : { bottom: -50, opacity: 0, duration: 350 },
722 '.caption-left' : { left: -150, opacity: 0, duration: 350 }
725 /* add a close button (x) to the caption */
726 .find('div[class*=caption]')
727 .css({ position: 'absolute' })
728 .prepend('&lt;span class="close"&gt;x&lt;/span&gt;')
729 .find('.close').click(function(){
730 var cap = $(this).parent(),
731 ani = { bottom : -50 }; // bottom
732 if (cap.is('.caption-top')) { ani = { top: -50 }; }
733 if (cap.is('.caption-left')) { ani = { left: -150 }; }
734 if (cap.is('.caption-right')) { ani = { right: -150 }; }
735 cap.animate(ani, 400, function(){ cap.hide(); } );
737 });</pre>
738 </div>
740 </div>
742 </div>
744 </body>
746 </html>