Skip to content

Commit

Permalink
Merge pull request #4 from VinSpee/master
Browse files Browse the repository at this point in the history
Check if an instance of fitWeird exists
  • Loading branch information
davatron5000 committed Aug 24, 2012
2 parents b3ae0ca + 516d004 commit 055cc99
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions fitWeird.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,20 @@ var fillVars = function(){

var setupFitWeird = function(){

var newDiv = document.createElement('div');
var newContent = '<span id=fitweird-width-px></span>px &times; <span id=fitweird-height-px></span>px ';
newContent += ':: <span id=fitweird-width-em></span>em &times; <span id=fitweird-height-em></span>em';
newDiv.style.position = 'fixed';
newDiv.style.bottom = '0';
newDiv.style.right = '0';
newDiv.style.backgroundColor = 'rgba(58, 58, 58, 0.8)';
newDiv.style.padding = '0.4em 1em';
newDiv.style.color = '#00CC00';
newDiv.style.fontFamily = 'monospace';
newDiv.innerHTML = newContent;
document.body.appendChild(newDiv);
if ( !document.getElementById('fitweird-width-px') ) {
var newDiv = document.createElement('div');
var newContent = '<span id=fitweird-width-px></span>px &times; <span id=fitweird-height-px></span>px ';
newContent += ':: <span id=fitweird-width-em></span>em &times; <span id=fitweird-height-em></span>em';
newDiv.style.position = 'fixed';
newDiv.style.bottom = '0';
newDiv.style.right = '0';
newDiv.style.backgroundColor = 'rgba(58, 58, 58, 0.8)';
newDiv.style.padding = '0.4em 1em';
newDiv.style.color = '#00CC00';
newDiv.style.fontFamily = 'monospace';
newDiv.innerHTML = newContent;
document.body.appendChild(newDiv);
}

};

Expand Down

0 comments on commit 055cc99

Please sign in to comment.