forked from FiNGAHOLiC/jquery.replacesvg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (72 loc) · 2.28 KB
/
index.html
File metadata and controls
72 lines (72 loc) · 2.28 KB
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
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="">
<meta name="description" content="">
<title>jquery.replacesvg.js</title>
<style>
.red { color: red; }
.blue { color: blue; }
pre { border: 1px solid #000; padding: 10px; }
</style>
</head>
<body>
<div class="area-body">
<h1>jquery.replacesvg.js</h1>
<p>jquery.replacesvg.js is a simple svg replacement plugin.</p>
<section>
<h1>Demo</h1>
<section>
<h1>1. Graceful Degradation Mode</h1>
<p><img src="./img/star.svg" width="100" height="95" alt="star" data-altimgsrc="./img/star.png" class="js-replacesvg1"></p>
<p>If browser support SVG, do nothing.<br>If not, replace <b class="blue">star.svg</b> with <b class="red">star.png</b>.</p>
<p>
<pre><img src="./img/star.svg" width="100" height="95" alt="star" data-altimgsrc="./img/star.png" class="js-replacesvg1"></pre>
</p>
<p>
<pre>
$('.js-replacesvg1').replacesvg({
defaultsvg: true
});
</pre>
</p>
</section>
<section>
<h1>2. Progressive Enhancement Mode</h1>
<p><img src="./img/star.png" width="100" height="95" alt="star" data-altimgsrc="./img/star.svg" class="js-replacesvg2"></p>
<p>If browser support SVG, replace <b class="red">star.png</b> with <b class="blue">star.svg</b>.<br>If not, do nothing.</p>
<p>
<pre><img src="./img/star.png" width="100" height="95" alt="star" data-altimgsrc="./img/star.svg" class="js-replacesvg2"></pre>
</p>
<p>
<pre>
$('.js-replacesvg2').replacesvg({
defaultsvg: false
});
</pre>
</p>
</section>
</section>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="./js/jquery-1.8.3.min.js"><\/script>')</script>
<script src="./js/jquery.replacesvg.js"></script>
<script>
// Sample 1
$(function(){
$('.js-replacesvg1').replacesvg({
defaultsvg: true
});
});
// Sample 2
$(function(){
$('.js-replacesvg2').replacesvg({
defaultsvg: false
});
});
</script>
</body>
</html>