Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/01/2013, 12:22
serg_prog
 
Fecha de Ingreso: septiembre-2011
Mensajes: 60
Antigüedad: 12 años, 8 meses
Puntos: 1
Respuesta: ¿Qué está mal aquí?

Cita:
Iniciado por David Ver Mensaje
Además del error en el nombre de la variable al comparar (SidebarHeight), con el método css() no puedes usar la forma corta "border", debes especificar border-left, border-right, etc.
Ok, lo he corregido, pero sigue sin funcionar:


Código:
<script type="text/javascript">

SidebarHeight = $(".sidebar").outerHeight() 
PostHeight = $(".post").outerHeight()

if (SidebarHeight > PostHeight) {
	   $(".sidebar").css({ border-right: "1px" });
} else {
	   $(".post").css({ border-left: "1px" });
}

</script>