| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

根据屏幕的宽度自动调整字体大小的功能:jQuery.fontFlex

一个轻量级</span>jQuery扩展,能够根据屏幕/浏览器宽度动态变化页面字体大小旨在实现自适应CSS布局</span>

安装

Include the latest version of jQuery and jQuery.fontFlex.js in the <head> of your HTML document:

<script src="jQuery.min.js"></script>    <script src="jQuery.fontFlex.js"></script> 

如何使用

Define a default CSS font base by setting font-size: 1em and line-height: 150% on the body or intended element. Declaring the font-size is optional, but highly recommended in case javascript is disabled. Finally, call the plugin on said element.

Syntax Example

$(function() {      // All elements    $('body').fontFlex(14, 20, 70);      // H1 only    $('h1').fontFlex(24, 36, 70);     });

Custom Parameters
min Minimum font-size in pixels
max Maximum font-size in pixels
mid Mid-range buffer. Values ranging from 60 to 70 produce the best results. Lower values produce a larger initial font-size, while higher values produce the opposite. Adjust accordingly to fit your requirements.

Live Demo: http://code.nath.co/fontFlex

浏览器支持

– Google Chrome
– Safari ( Desktop and Mobile )
– Internet Explorer ( 9, 10, 11 )
– Firefox

项目主页:http://www.open-open.com/lib/view/home/1411391007609

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1411391007609.html
jQuery Ajax框架 jQuery.fontFlex