Responsive square DIV

window.onresize = function(){ var parent = document.getElementById('cont'); var childCount = parent.getElementsByTagName('div').length; for (i = 0 ; i < childCount ; i++){ document.getElementById('finestra'+i).style.width = '40%'; hg = $('#finestra0').width(); $('#finestra'+i).css({'height':hg+'px'}); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.