我正试图在FlowType.JS上使用this site。
我的头脑中有以下内容:
<script type='text/javascript' src='http://www.bibandtucker.net.au/test/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script>
<script type="text/javascript" src="http://www.bibandtucker.net.au/test/wp-content/themes/blueduck3/js/flowtype.js"></script>
<script type="text/javascript">
$('body').flowtype({
minimum : 500,
maximum : 1200,
minFont : 12,
maxFont : 40,
fontRatio : 30
});
</script>
然而,当我使视口变小时,#content P,H1和#menu A,p.bookings,div.opening-hours不会向下缩放。
有谁知道为什么?感谢。
答案 0 :(得分:3)
请输入此代码,并确保在代码之前调用flowtype.js。
<script type="text/javascript">
$j = jQuery.noConflict();
$j(document).ready(function() {
/*$j('body').flowtype({
minimum : 500,
maximum : 1200,
minFont : 12,
maxFont : 20
});
*/
$j("body").flowtype({
minFont: 16,
maxFont: 40,
fontRatio: 65
});
$j("#heading").flowtype({
fontRatio: 36
});
$j("#content p").flowtype({
minFont: 12,
maxFont : 22,
fontRatio: 20
});
$j("#menu a").flowtype({
minFont: 16,
fontRatio: 5
});
$j("p.bookings").flowtype({
minFont: 11,
fontRatio: 30
});
$j("div.opening-hours").flowtype({
minFont: 18,
fontRatio: 30
});
});
</script>
另外,请注意插件网站上提到的以下几行。
Line-height
In v1.0 of FlowType, we made the plugin set a specific line-height in pixels. We received many statements that setting a specific line-height is very dangerous. So, what did we do? We removed support for line-height in v1.1. What do I do now? It's quite simple: use unitless line-height in your CSS. It will make automatically make changes based on whatever the font-size. Here's an example of what we suggest for line-height: fontRatio : 30;
如果您还有其他问题,请提供指向您的jsfiddle代码的链接。
答案 1 :(得分:1)
这是因为你包括2个jquery版本jquery-2.1
和jquery 1.6.4
,并且两个版本都存在冲突。你可以在控制台中看到它。
使用jquery.noConflict()进行无冲突