Last active
September 22, 2015 20:23
-
-
Save ghorvat/b6df5e39527dbb682cef to your computer and use it in GitHub Desktop.
This file contains 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
jQuery(function(){ | |
var h1 = 0; | |
var h2 = 0; | |
jQuery(".height1").each(function(){ | |
h1 = jQuery(this).outerHeight(); | |
}); | |
jQuery(".height2").each(function(){ | |
h2 = jQuery(this).outerHeight(); | |
}); | |
console.log(h1 + " " + h2) | |
var calc = h2/h1*100; | |
console.log(calc); | |
if (document.styleSheets[0]){ | |
document.styleSheets[0].addRule('.square-tile::before','padding-top:100%'); | |
document.styleSheets[0].insertRule('.square-tile::before' + '{padding-top:' + calc + '%' + '!important}', 0); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment