I've been looking around and there's really not much on how to make font previews (to show the text in the same font they're selecting) in a dropdown list. Can anybody point me in the right direction? Thanks.
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
You might want to use the HiGoogleFonts.
It doesn't load all the fonts as you scroll. It only loads the fonts that are clicked. For font preview , It is using a single image which loads very fast . It has 700+ fonts
Download it from github
See demo here
To offer an alternative to using only a
select
element, that will allow for styling the font, and applying other css, while updating a traditionalselect
element for submission to the server/script:html:
jQuery:
JS Fiddle demo.
Notes:
li
elements will be the same as the order of theoption
elements, since theoption
that becomesselected
is chosen by index (of theli
).References:
click()
.index()
.removeAttr()
.eq()
.attr()
.removeClass()
.addClass()
.