A handy little font selection widget.
At only 3kb fontSelector is a lightweight, easy solution, so check out the example and then download it for yourself.
This is an example of the light-weight, flexible font selecting widget for mootools.
A simple font changer widget
mootools Moo.js, Utility.js, Element.js, Function.js, Dom.js, Array.js, String.js, Event.js, Common.js, Window.Size.js, Fx.Style.js, Fx.Styles.js, Fx.Base.js, Fx.CSS.js
Justin Maier, http://justinmaier.com
MIT-style license.
A simple font changer widget.
Tested in Firefox 2.0, and IE6-7 on XP SP2
None
element the element you want to apply the font changing to
options an object. See options below.
onSelect Add additonal effects to what happens when you select the font (like changing text color)
fontList List of available fonts (ie fontList: ['arial','century gothic', 'tahoma', 'verdana'])
fade True or False. Fade the selector in/out. (defaults to true)
className The Class applied to the widget. (defaults to 'fontSelection')
(start code)
<h1>I am Justin</h1>
<p>Hello World</p>
<script>
var fSelector = new fontSelector($$('p','h1'),{fontList: ['Arial','Times new roman','Century Gothic']);
</script>
(end)
show show the editor (pass element, and event).
hide hide the editor.
remove remove/kill the editor.
Get it while its hot. fontSelector.js | fontSelector.packed.js