A custom combo box to allow font selection from a preset list, whilst previewing the font
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8259203 Aug 29, 2017
Failed to load latest commit information.
examples Change example selection message to check issue #4 Mar 25, 2014
src Match root width Dec 2, 2015
.gitignore Added ignore Mar 20, 2012
LICENSE Added LICENSE Aug 28, 2017
README.markdown Tweak README. Dec 3, 2015



A working demo of the files in the examples folder can be found at: http://s3.amazonaws.com/jquery-font-chooser/examples/example.html


<div id="fontSelect" class="fontSelect">
	<div class="arrow-down"></div>

To turn the above into a font selector dropdown:

		'hide_fallbacks' : true,
		'initial' : 'Courier New,Courier New,Courier,monospace',
		'selected' : function(style) { alert(style); },
		'opened' : function(style) { alert('opened'); },
		'closed' : function(style) { alert('closed'); },
		'fonts' : [
			'Arial Black,Arial Black,Gadget,sans-serif',
			'Comic Sans MS,Comic Sans MS,cursive',
			'Courier New,Courier New,Courier,monospace',
			'Lucida Console,Monaco,monospace',
			'Lucida Sans Unicode,Lucida Grande,sans-serif',
			'Palatino Linotype,Book Antiqua,Palatino,serif',
			'Times New Roman,Times,serif',
			'Trebuchet MS,Helvetica,sans-serif',
			'Gill Sans,Geneva,sans-serif'

The hide_fallbacks option, when true, prevents the full font stack specified in the ul from being outputted. Instead only the first font name will be shown, the full font stack will be used specified in the css though. The function passed to selected will be called whenever a new font is selected, the first argument is the full font stack. The inital font is the font be initially shown in the dropdown.