-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·121 lines (102 loc) · 6.45 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Smart Loader jQuery Plugin</title>
<meta name="description" content="SmartLoader is a small image loader plugin for jQuery 1.9/2.0 with useful callback functions and easy configuration">
<link href='http://fonts.googleapis.com/css?family=Exo:100,200,300,400,600,700' rel='stylesheet' type='text/css'>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=css&skin=sunburst"></script>
<meta name="viewport" content="width=900">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/smart-loader.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
<!-- this is the loader -->
<div id="smart-dimmer">
<!-- loader image -->
<img src="smart-loader-loaders/SmartLoader30.gif">
</div>
<!-- this is the loader END -->
<div class="blockTitle">
<h1>Smart Loader</h1>
<h3>a jQuery 1.9.X / 2.0.X Plugin</h3>
<div id="header">
<img src="img/icon-name.png" width="292" height="216">
</div>
<div id="download">
<a href="https://github.com/genoma/smart-loader/archive/master.tar.gz">DOWNLOAD TAR.GZ</a>
●
<a href="https://github.com/genoma/smart-loader/archive/master.zip">DOWNLOAD ZIP</a>
●
<a href="https://github.com/genoma/smart-loader">GITHUB PAGE</a>
</div>
<hr>
<h2>The Plugin</h2>
<p><strong>Smart Loader</strong> is a basic jQuery plugins that gives you the possibility to launch a function after all images are loaded. Two <strong>callbacks</strong> are provided to fully personalize the way the plugin behaves. It works with jQuery 1.9.x and the newest 2.0.x branch.</p>
<h2>Instructions</h2>
<p>More infos has been written on <a href="https://github.com/genoma/smart-loader">GitGub</a> repository page, but the code down here should give you a good idea on how this plugin works.</p>
<pre class="prettyprint">
$(function () {
"use strict";
$(document).smartLoader({
// main control option can be **document** or **images**
// the first check the whole document and than calls the callback,
// the second does the same but place into every image that is waiting to be
// fully loaded an animated gif
theControl: 'document',
// **howManySeconds** is the maximum time you want to wait for
// images to be fully loaded expressed in milliseconds.
// After this amount of time the function throws the **errorCallback**
howManySeconds: 5000,
// **lengthOfLoop** this is the time delay between every single check loop,
// expressed in milliseconds, should be no less than 200.
lengthOfLoop: 200,
// the callback in case any image is successfully loaded
callback: function () {
$('#smart-dimmer').fadeOut(1000);
console.log('this is the callback');
},
// the callback in case there was one or more images
// that failed to load in the prefixed amount of time
errorCallback: function () {
$('#smart-dimmer').fadeOut(1000);
console.log('missing images');
}
});
});
</pre>
<h2>Installation</h2>
<p>Easy and simple: put the smart-loader-loaders folder inside the root of your website, link smart-loader.min.js.</p>
<h2>Contacts</h2>
<p>If you need help you can contact me on Twitter @jenoma or on ADN @genoma.</p>
<h2>MIT License</h2>
<h4>Copyright © 2013 Alessandro Vioni coding - @jenoma & Marco Temperilli images - @MARCOMAIK</h4>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ntation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<div style="height: 150px;"></div>
</div>
<footer>
© 2013 Alessandro Vioni Coding & Marco Temperilli Graphics
</footer>
<script>
var _gaq=[['_setAccount','UA-18195903-9'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/smart-loader.js"></script>
<script src="js/main.js"></script>
</body>
</html>