Skip to content

Instantly share code, notes, and snippets.

@livibetter
Created January 27, 2013 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save livibetter/4650697 to your computer and use it in GitHub Desktop.
Save livibetter/4650697 to your computer and use it in GitHub Desktop.
jQuery TextFill bug template
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>jQuery plugin: TextFill test</title>
<!-- Make sure jQuery version is correct -->
<script src='http://code.jquery.com/jquery-1.8.3.js'></script>
<!-- Make sure jQuery TextFill version is correct
1. Go to https://github.com/jquery-textfill/jquery-textfill/tags
2. Browser source of the version, usually it's the latest one.
3. Select jquery.textfill.js.
4. Copy the raw URL of the file, it looks like
https://github.com/jquery-textfill/jquery-textfill/raw/{:version}/jquery.textfill.js
5. Replace the script's src attribute.
-->
<script src="http://jquery-textfill.github.com/jquery-textfill/jquery.textfill.min.js"></script>
<!-- Make sure the font-family is right one -->
<link href='http://fonts.googleapis.com/css?family=VT323' rel='stylesheet' type='text/css'>
<style type='text/css'>
#jtf {
width: 200px;
height: 160px;
border: 1px solid red;
}
#jtf span {
/* Make sure the font-family is right one */
font-family: "VT323";
}
</style>
<script>
function init() {
$('#jtf').textfill({
debug: true,
maxFontPixels: 0
});
}
$(init);
</script>
</head>
<body>
<div id='jtf'><span>test text</span></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment