Skip to content

Instantly share code, notes, and snippets.

@jayontraps
Forked from aarongustafson/getActiveMQ.js
Last active August 29, 2015 14:14
Show Gist options
  • Save jayontraps/88af4b5d30097f2422e4 to your computer and use it in GitHub Desktop.
Save jayontraps/88af4b5d30097f2422e4 to your computer and use it in GitHub Desktop.
(function($,window){
window.getActiveMQ = function()
{
$('<div id="getActiveMQ-watcher"></div>')
.appendTo('body')
.hide();
var computed = window.getComputedStyle,
watcher = document.getElementById('getActiveMQ-watcher');
if ( 'currentStyle' in watcher )
{
window.getActiveMQ = function()
{
return watcher.currentStyle['fontFamily'].replace(/['"]/g,'');
};
}
else if ( computed )
{
window.getActiveMQ = function()
{
return computed( watcher, null ).getPropertyValue( 'font-family' ).replace(/['"]/g,'');
};
}
else
{
window.getActiveMQ = function()
{
return 'unknown';
};
}
return window.getActiveMQ();
};
}(jQuery, window))
#getActiveMQ-watcher {
font-family: "break-0";
}
@media only screen and (min-width: 20em) {
#getActiveMQ-watcher {
font-family: "break-1";
}
}
@media only screen and (min-width: 30em) {
#getActiveMQ-watcher {
font-family: "break-2";
}
}
@media only screen and (min-width: 48em) {
#getActiveMQ-watcher {
font-family: "break-3";
}
}
/* etc. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment