Comunidad de diseño web y desarrollo en internet online

Screen.width, variando width de un elemento según resolución.

Citar            
MensajeEscrito el 02 Abr 2011 10:13 am
Buenas,
variando width de un elemento según resolución.

var ancho=screen.width;
var ancho_minimo=1400;
if (screen.width<ancho_minimo)
{
agrandar();
}

function agrandar()
{
document.getElementById("taldiv").style.width="1400px";
}

Por defecto tiene un width de 100%, agradezco ayuda.

Saludos

Por neisserian89

65 de clabLevel



 

firefox
Citar            
MensajeEscrito el 02 Abr 2011 12:16 pm
¿Agradeces la ayuda en qué exactamente?, no has hecho ninguna pregunta :S

A propósito, no necesitas trastear con JS para lograr lo que quieres, usando la propiedad min-width de CSS logras lo mismo sin código JS.

Por DriverOp

Claber

2510 de clabLevel



 

opera
Citar            
MensajeEscrito el 02 Abr 2011 03:11 pm
Agradezco la ayuda si me aclaran por que no me funciona ese código jeje.

Ok, mirare el min-width

Por neisserian89

65 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.