Created
October 10, 2012 09:37
-
-
Save josher19/3864380 to your computer and use it in GitHub Desktop.
Get & Test Google Web Fonts and rotate through them by clicking on text. Chrome bookmarklet, requires jQuery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
sel=document.getSelection() | |
// if (sel.focusNode) sel.focusNode.parentElement.style.fontFamily="'Poller One',sans-serif" | |
// function styling(ev) { sel.focusNode.parentElement.style.fontFamily="'Poller One',sans-serif"; } | |
// jQuery(document.body).bind('mouseup', styling, false); | |
function styling(ev) { sel.focusNode.parentElement.style.fontFamily= fontList[++styling.count % fontList.length] } | |
styling.count = 0; styling.fontList = fontList = ["Poller One", "Marck Script", "Ewert"]; | |
styling.fontListCss = 'http://fonts.googleapis.com/css?family=' + styling.fontList.map(escape).join("|") | |
jQuery(document.body).append(jQuery("<link href='http://fonts.googleapis.com/css?family=Poller+One|Marck+Script|Ewert' rel='stylesheet' type='text/css' />")) | |
fontList.push(""); | |
jQuery(document.body).unbind('mouseup').bind('mouseup', styling, false); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment