forked from filamentgroup/Responsive-Images
-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo.html
43 lines (37 loc) · 1.85 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Responsive Images Test Page</title>
<script>
var rwd_options = {
translateUrl: function(url) {
return url.replace(/\.(jpe?g|png|gif)$$/, function(str, p1) {
return "@2x." + p1;
})
}
}
</script>
<script src="rwd-images/rwd-images.js"></script>
<!-- demo styles -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body { font-family: Helvetica, sans-serif; background: #222; color: #eee; margin: 20px auto; padding: 0 20px; max-width: 980px; }
img { border: 0; width: 100%; display: block; max-width: 100%; }
#cred { font-size: .7em; color: #aaa; }
a { color: #fff; }
.minimal { max-width: 50%; margin: 20px auto;}
</style>
</head>
<body>
<h1>Responsive Images Test Page</h1>
<p>In supported browsers, the following images will load either small or large versions depending on the size they need to be rendered at, making a single 1kb request before requesting the appropriate size.</p>
<!-- ADD THE "r." prefix to your image extension for any responsive images -->
<img src="sample-content/running.jpg?r=/sample-content/running-lrg.jpg" width="320" data-width="320">
<img src="sample-content/second-running.jpg?r" width="320" data-width="320" class="minimal">
<p>The next image, does not have a high source version, so shows at the normal resolution.</p>
<!-- Check that this does not get 'responsified' -->
<img src="sample-content/second-running.jpg" width="320" data-width="320" class="minimal">
<p id="cred"><strong>Photo credit (CC):</strong> Cia de Foto <a href="http://www.flickr.com/photos/ciadefoto/3192757134/in/pool-809956@N25/">Flickr Creative Commons</a></p>
</body>
</html>