-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
40 lines (32 loc) · 1.35 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
<html>
<head>
<title>HiGoogleFonts - Fast Font Picker with preview</title>
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.full.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script>
<script src="js/fonts.js"></script>
<link rel="stylesheet" href="css/fonts.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css">
</head>
<body>
<h3>HiGoogleFonts - Fast Font Picker with preview</h3>
<select id="select_fontfamily" style="width: 230px;"></select>
<p>Select a font from the list of 700+ google fonts to apply it to the text below</p>
<p id="paragraph" style="font-size: 20px;">This is the preview of the font selected</p>
<script type="text/javascript">
$(document).ready(function() {
$( "#select_fontfamily" ).higooglefonts({
selectedCallback:function(e){
console.log(e);
},
loadedCallback:function(font){
console.log(font);
/*/////// This is where you should apply font.///////
/////////////////////////////////////////////////////*/
$("#paragraph").css("font-family", font); // Change the font-family of the #paragraph
}
});
});
</script>
</body>
</html>