-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
97 lines (93 loc) · 2.48 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script src="./js/jquery.inline-currency.js"></script>
<link rel="stylesheet" href="./css/jquery.inline-currency.css" />
<script>
$(document).ready(function () {
$('.jic').inlineCurrency();
$('.jic-test').inlineCurrency({
"thousandsSplit": " ",
"decimalsSplit": ","
});
});
</script>
<title></title>
<style media="screen">
code {
background: #eee;
padding: 5px 20px;
display: block;
margin-top: 5px;
white-space: pre;
line-height: 15px;
overflow-x: auto;
}
hr {
display: block;
height: 1px;
width: 100%;
background: #ccc;
border: none;
margin-bottom: 30px;
}
.jic-test {
position: relative;
border-bottom: dotted 1px #ccc;
cursor: default;
}
.jic-test:hover .jic-container {
opacity: 1;
visibility: visible;
}
.demo {
font-size: 18px;
}
</style>
</head>
<body style="font-family: Helvetica, Arial, sans-serif;">
<h1>jQuery Inline Currency (JIC) Demo</h1>
<p>
First of all, move each price into span element:
</p>
<code>
<span class="jic">$10</span>
</code>
<p>
And then, apply inlineCurrency plugin to your elements:
</p>
<code>
$(document).ready(function () {
$('.jic').inlineCurrency();
});
</code>
<p>Result:</p>
<p class="demo">You can buy it for <span class="jic">$10</span></p>
<hr>
<p>You can use inline parameters for special cases:</p>
<code>
<span class="jic" data-jic-value="10" data-jic-currency="EUR" data-jic-convert-to="rub, usd, chf">Ten euros</span>
</code>
<p>Result:</p>
<p class="demo">
<span class="jic" data-jic-value="10" data-jic-currency="EUR" data-jic-convert-to="rub, usd, chf">Ten euros</span>
</p>
<hr>
<p>
If you use decimal or thousands separators in prices, you can set config:
</p>
<code>
$(document).ready(function () {
$('.jic-test').inlineCurrency({
"thousandsSplit": " ",
"decimalsSplit": ","
});
});
</code>
<p>Result:</p>
<p class="demo"><span class="jic-test">$100 000,20</span></p>
</body>
</html>