【发布时间】:2015-11-22 17:39:29
【问题描述】:
我想在 phonegap 项目中更改字体系列。
表示用户可以通过选择任意字体来更改设置中的字体系列。
我该怎么做?
提前致谢
编辑: 似乎它不起作用。这是我的 jquery 代码:
$("#font-selector").change(function(){
$(".size").css("font-family",$("#font-selector").val());
});
而html代码是:
<select name="changeFont" id="font-selector" onchange='$("body").attr("data-font", $("#font-selector").val())'>
<option value="my font">my font</option>
<option value="my font">my font</option>
而css代码是:
@font-face {
font-family: 'my font';
src: url('my font.eot');
src: url('my font.eot?#iefix') format('embedded-opentype'),
url('my font.woff2') format('woff2'),
url('my font.woff') format('woff'),
url('my font.ttf') format('truetype'),
url('my font.svg#my font') format('svg');
font-weight: normal;
font-style: normal;
问题出在哪里?
【问题讨论】: