Skip to content

Instantly share code, notes, and snippets.

@wescleymatos
Last active December 18, 2015 01:48
Show Gist options
  • Save wescleymatos/5706089 to your computer and use it in GitHub Desktop.
Save wescleymatos/5706089 to your computer and use it in GitHub Desktop.
Pega a altura das divs e ordena o array de forma descendente.
$(document).ready(function() {
var alturaMenu = $("#menu_vertical").height(),
alturaUltimasNoticias2 = $("#ultimas_noticias_2").height(),
alturaNoticiasDetalhe = $("#noticias_detalhe").height();
var alturas = new Array(alturaMenu, alturaNoticiasDetalhe, alturaUltimasNoticias2);
alturas = alturas.sort(function(a,b){return b-a});
console.log(alturas);
});
// ou
$(document).ready(function() {
window.onload = function (){
var alturaContainer = $("#container").height();
var alturaMenu = $("#menu_vertical").height();
var alturaUltimasNoticias2 = $("#ultimas_noticias_2").height();
var alturas = new Array(alturaMenu, alturaContainer, alturaUltimasNoticias2);
alturas = alturas.sort(function(a,b){return b-a});
$("#rodape_interno").css("top", alturas[0] + 250);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment