gpt4 book ai didi

javascript - FlowType.JS 不工作

转载 作者:行者123 更新时间:2023-11-30 10:14:32 25 4
gpt4 key购买 nike

我正在尝试使用 FlowType.JSthis 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>

但是,当我缩小视口(viewport)时,#content P、H1 和#menu A、p.bookings、div.opening-hours 不会向下缩放。

有人知道为什么吗?谢谢。

最佳答案

请输入此代码,并确保在代码之前调用了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 代码的链接。

关于javascript - FlowType.JS 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24603119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com