-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
96 lines (92 loc) · 4.46 KB
/
README.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
<p>Timed Page Loader, a jQuery plugin
Show a timer bar before the next Ajax page load</p>
<p>This plugin lets you automatically load page via Ajax and ideal for kiosk applications. The reader get visual feedback and clicking on the time bar stops and contionues the animation. There are even direct links that take the reader immediately to the next page if needed.</p>
<p>See it in action: <a href="http://rayhyde.github.io/timed_page_loader/">http://rayhyde.github.io/timed_page_loader/</a></p>
<p><h2>The Goodies</h2></p>
<p><ul>
<li>You can start/stop the loading by clicking on the timer bar.</li>
<li>You can activate the plugin on as many elements on the page as you need, bar the processing limits of your viewer's computer, of course.</li>
<li>The plugin looks at a link in the loaded pages with the class name ".next-page" and uses that to load the next page in the background while still showing the first page. In these examples, the link works and loads the next page when clicked. You might also opt to hide it via CSS.</li>
<li>You can set the speed of the loading time and you have the choice of a vertical or a horizontal loading bar.</li>
<li>The loading bar you can style as you want - have it fixed on the side of the page, see-through, or even hidden.</li>
</ul></p>
<p><h2>How to use this plugin</h2></p>
<p><h3>1. Link the files you need</h3></p>
<p>Include the jQuery script at the bottom of your page, e.g. through a CDN:</p>
<p><code> <script src="//code.jquery.com/jquery-2.1.3.min.js"></script></code></p>
<p>Then include the minimized version of the script:</p>
<p><code><script src="[path to your script]/jquery.timed-page-loader.min.js"></script></code></p>
<p>Change [path to your script] to where it resides, eg "js".</p>
<h3>2. Create your HTML markup</h3>
<p>This is very simple: create an element and style the element containing it. Like</p>
<pre><div id="wrap1" class="page-wrap"></div>
<style>
.page-wrap {
height: 360px;
}
.fuse-container {
background: slateblue;
...
}
.fuse-container .fuse {
background: #9F95DF;
...
}
...
</style>
</pre>
<h3>3. Call the plugin</h3>
<p>Then initialize the plugin, telling it in which element it needs to run:</p>
<pre>
<script>
$(<containing element here, e.g. "#wrap1">).timedPageLoader({
fuseTime: 10000,
firstPage: 'page1.html',
direction: 'vertical'
});
// a second container:
$(<containing element here, e.g. "#wrap2">).timedPageLoader({
fuseTime: 12000,
firstPage: 'newpage1.html',
direction: 'horizontal'
});
</script>
</pre>
<h3>4. Putting it all together</h3>
<p>This is your basic page to get the plugin up and running:</p>
<pre><!DOCTYPE html>
<html>
<head>
...
<link rel="stylesheet" href="css/mytime_pageloader.css">
</head>
<body>
...
<div id="wrap1" class="page-wrap"></div>
...
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="js/jquery.timed_page_loader.min.js"></script>
<script>
$('#wrap1').timedPageLoader();<br> </script>
</body>
</html>
</pre>
<h2>Options</h2>
<p>If you don't specify options, like in the example above, the plugin will use its default settings:
<br> - loading speed: 10000 in thousands of a second, so 10 seconds
<br> - the first page that gets loaded is 'page1.html'
<br> - a horizontal bar
</p>
<p>These are the options:</p>
<h3>Speed</h3>
<p>in the usual thousands of seconds</p>
<code>fuseTime: 10000</code>
<h3>First page to load</h3>
<p>The first page that needs to be loaded via Ajax:</p>
<code>firstPage: 'page1.html'</code>
<h3>Horizontal or vertical bar</h3>
<p>You can specify if you want a horizontal or a vertical timer bar.</p>
<code>direction: 'vertical'</code>
<h3>Playground</h3>
<p>This jQuery plugin is part of my Playground - a collection of fun stuff I made in the past, from jQuery games and plugins to CSS animation tests.</p>
<p>Please drop in on my portfolio site at <a href="http://www.rayhyde.nl">www.rayhyde.nl!</a></p>