Foros del Web » Creando para Internet » CSS »

barra fixed + desplazamiento horizontal

Estas en el tema de barra fixed + desplazamiento horizontal en el foro de CSS en Foros del Web. Hola, qué tal? Estoy desarrollando un sitio en el cual hay 3 módulos o secciones que se desplazan de manera horizontal, cada vez que voy ...
  #1 (permalink)  
Antiguo 11/10/2011, 18:17
Avatar de Martriay  
Fecha de Ingreso: noviembre-2010
Mensajes: 80
Antigüedad: 13 años, 5 meses
Puntos: 5
barra fixed + desplazamiento horizontal

Hola, qué tal? Estoy desarrollando un sitio en el cual hay 3 módulos o secciones que se desplazan de manera horizontal, cada vez que voy a una sección se scrollea hacia ella de forma horizontal, quedó muy bien eso gracias a un poco de jQuery.

Mi problema es que tengo una barra flotante arriba de todo donde está el menú, está en fixed para que se desplaze junto con el resto del sitio al scrollear hacia los lados, el problema es cuando el navegador tiene una altura menor al contenido del sitio, que si me desplazo hacia abajo, la barra flotante (position:fixed) lo tapa, no quiero que suceda esto, quiero que la barra quede arriba si se scrollea hacia abajo, es decir, que sólo esté fixed en sentido horizontal, ya que no ocupa todo el ancho del sitio, y al estar superpuesta sobre una seccion, si cambio a otra, se ve por el costado de la misma parte del sitio y queda mal.

No se si me explico bien, me gustaría que los div con contenido 'choquen' contra la barra, pero que a su vez esté como fixed en el sentido horizontal.

Con frames supongo que sería mucho más sencillo, pero prefiero evitarlos.

Mi código:

Código HTML:
<body>
		<div id='top'>
			<a href="http://www.martriay.com.ar"> <img src="images/logo.jpg" border="0" alt="Martin Triay" width="350" height="120" /> </a>
			<div id='menu'>
				<ul class='menu'>
					<li><a href="#yo">Martin who?</a></li>
					<li><a href="#work">Some of my work</a></li>
					<li><a href="#form">Contact me!</a></li>
				</ul>
			</div>
		</div>
		<div id='container'>
			<div id='yo'>
				<div class='wrapper'>
					<img class='title' src="images/martnwho.jpg" border="0" alt="Martin who?" align="bottom" width="170" height="30" />
					<p>Hi, I'm Martin Triay, an argentinian web developer. I've been learning about web coding and designing by myself since I was 10. Now I'm 17 and still learning. Please keep in mind this site is still under construction.</p>
				</div>
			</div>
			<div id='work'>
				<div class='wrapper'>
					<img class='title' src="images/smfmywrk.jpg" border="0" alt="Some of my work" align="bottom" width="220" height="30" />
					<p>I like to work with valid <b>xHTML</b> + <b>CSS</b>, <b>JavaScript</b> (+<b>JQuery</b>), <b>AJAX</b> (XML + Javascript) and <b>PHP</b> + <b>MySQL</b>. I also work with CMS such as Joomla! or Wordpress.</p>
					<p>What does this mean? It means that I can develop dynamic, fast and interactive sites which can also interact with databases.</p>
					<p>I'm always looking for new projects to improve my abilities, taking every work as a new challenge to grow with. Would you like to see some of my work?</p>
					<div id='slider'>
						<a href="http://estudio-rh.com.ar" target="_blank">
							<img src='images/estudio.jpg' width="400" height="300">
							<span>
								Estudio Rodr&iacute;guez Herrera
							</span>
						</a>
						<a href="http://polimata.com.ar" target="_blank">
							<img src='images/polimata.jpg' width="400" height="300">
							<span>
								Pol&iacute;mata
							</span>
						</a>
					</div>
				</div>
			</div>
			<div id='form'>
				<div class='wrapper'>
					<img class='title' src="images/contact.jpg" border="0" alt="Contact" align="bottom" width="120" height="30" />
					<form method="post" action="send.php"> 
						<input type="text" class="name" name="name" value="Who the hell are you?" onblur="if (this.value == '') {this.value = 'Who the hell are you?';}"  onfocus="if (this.value == 'Who the hell are you?') {this.value = '';}"/> 
						<input type="text" class="email"  name="mail" value="Email?" onblur="if (this.value == '') {this.value = 'Email?';}"  onfocus="if (this.value == 'Email?') {this.value = '';}" /> 
						<div class="clear"></div> 
							<textarea name="msg"></textarea> 
						<div class="clear"></div> 
							<input type="submit" value="Send" class="submit" /> 
						<div class="clear"></div> 
					</form>
				</div>
			</div>
		</div>
	</body> 
y el CSS:

Código HTML:
body {
	background-color:#A3BEDC;
	margin:0 auto 0 auto;
	width:850px;
	overflow-x: hidden;
	}
img.title {
	margin-top:7px;
	margin-bottom:9px;
	}
p {
	text-align:left;
	font-family: Tahoma;
	font-size: 14px;
	color: #214087;
	text-indent:15px;
	margin-top:0px;
	}
	
/* DIVS */

#top {
	width:850px;
	margin-left:auto;
	margin-right:auto;
	background-color:#A3BEDC;
	padding-top:10px;
	z-index:100;
	position:fixed;
	clear:both;
	}
#menu {
	margin-left:350px;
	float:left;
	}
#container {
	width:300%;
	position:absolute;
	}
.wrapper {
	padding-top:130px;
	width:500px;
	margin:auto;
	}
#yo,#work,#form {
	width:33.33%;
	float:left;
	}
/* FORM */

input[type=text] {
	color:#214087;
	font-size:12px;
	text-shadow:1px 1px #fff;
}
input[type=text].name {
	border:0;
	background-color:#C6E2FF;
	height:14px;
	width:180px;
	float:left;
	padding:10px 10px 10px 10px;
}
input[type=text].email {
	border:0;
	background-color:#C6E2FF;
	height:14px;
	width:180px;
	float:right;
	padding:10px 10px 10px 10px;
}
textarea {
	width:500px;
	max-width:500px;
	height:120px;
	max-height:120px;
	border:0;
	background-color:#C6E2FF;
	margin:20px 0;
	padding:0;
	font-family:Helvetica, Arial, sans-serif;
	font-size:12px;
	line-height:18px;
	color:#574d4a;
	text-shadow:1px 1px #fff;
}
input[type=submit].submit {
	border:0;
	color:#214087;
	background-color:#C6E2FF;
	height:30px;
	width:80px;
	float:right;
	margin:0 0 0 20px;
}
  #2 (permalink)  
Antiguo 12/10/2011, 07:00
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

si es factible hacerlo con css, perfecto. aprenderé algo. pero la única manera que conozco de hacerlo es con javascript (pageXOffset y pageYOffset)
  #3 (permalink)  
Antiguo 12/10/2011, 11:04
Avatar de memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 14 años, 10 meses
Puntos: 641
Respuesta: barra fixed + desplazamiento horizontal

si quieres que quede arriba por que no z-index?

edito: espera creo que no lei bien quieres que solo se mueva al scrollear a los lados, sip es lo que te dijo isabelM
  #4 (permalink)  
Antiguo 12/10/2011, 22:32
Avatar de Martriay  
Fecha de Ingreso: noviembre-2010
Mensajes: 80
Antigüedad: 13 años, 5 meses
Puntos: 5
Respuesta: barra fixed + desplazamiento horizontal

me explican un poco la función por favor? lei un par de explicaciones por google pero creo que no entendi bien
  #5 (permalink)  
Antiguo 13/10/2011, 04:56
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

estos métodos de usan para obtener la cantidad de pixel que el contenido se ha desplazado horizontal y verticalmente
  #6 (permalink)  
Antiguo 13/10/2011, 13:46
Avatar de Martriay  
Fecha de Ingreso: noviembre-2010
Mensajes: 80
Antigüedad: 13 años, 5 meses
Puntos: 5
Respuesta: barra fixed + desplazamiento horizontal

Pero lo que yo quiero es bloquear el desplazamiento de un div en particular, cómo puedo aplicar esa función para eso es mi pregunta.
  #7 (permalink)  
Antiguo 13/10/2011, 14:11
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

lo mas que puede hacer es dejarte este código para que tomes alguna idea
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="application/xhtml; charset=utf-8" />
<title></title>
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
position: relative;
}


#contenedor {
width: 750px;
height: auto;
margin: 0 auto;
}


.izq {
width: 500px;
height: auto;
background-color: orange;
float: left;
position: relative;
top: 100px;
}


#cont_fijar {
float: left;
}

#fijar {
width: 200px;
height: 200px;
position: relative;
top: 100px;
border: 1px solid red;
}
</style>
<script type="text/javascript">
function GetZoomFactor () {
var factor = 1;
if (document.body.getBoundingClientRect) {
// rect is only in physical pixel size in IE before version 8
var rect = document.body.getBoundingClientRect ();
var physicalW = rect.right - rect.left;
var logicalW = document.body.offsetWidth;

// the zoom level is always an integer percent value
factor = Math.round ((physicalW / logicalW) * 100) / 100;
}
return factor;
}




function fnc() {
var info = document.getElementById ("fijar");
info.innerHTML = "Horizontal: " + window.pageXOffset + "px<br/>Vertical: " + window.pageYOffset + "px";

if ('pageXOffset' in window) { // todos excepto ie8-

if (window.pageYOffset >= 100) {
info.style.position = 'fixed';
info.style.top = 0;
} else {
info.style.position = 'relative';
info.style.top = '100px';
}

}else {
var zoomFactor = GetZoomFactor ();
var scrollTop = Math.round (document.documentElement.scrollTop / zoomFactor);


if (scrollTop >= 100) {
info.style.position = 'fixed';
info.style.top = 0;
} else {
info.style.position = 'relative';
info.style.top = '100px';
}
}

}

window.onscroll = function() {fnc();};
</script>
</head>
<body>

<div id="contenedor">



<div class="izq">
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
<br /><br /><br /><br /><br /><br /><br /><br />
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
<br /><br /><br /><br /><br /><br /><br /><br />
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
<br /><br /><br /><br /><br /><br /><br /><br />
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
<br /><br /><br /><br /><br /><br /><br /><br />
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
<br /><br /><br /><br /><br /><br /><br /><br />
Suspendisse potenti. Praesent ut risus ligula, quis ultrices libero. Sed faucibus leo vitae tortor tincidunt eget pulvinar nulla suscipit. Vestibulum eget libero metus, sit amet iaculis ante. Curabitur sed ligula dolor. Aliquam erat volutpat. Cras sit amet ligula dolor, a eleifend sapien. Nam lobortis turpis nec nisl tempor sit amet malesuada diam luctus.
</div>

<div id="cont_fijar">
<div id="fijar"></div>
</div>

</div>
</body>
</html>
  #8 (permalink)  
Antiguo 14/10/2011, 07:52
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: barra fixed + desplazamiento horizontal

Cita:
Iniciado por memoadian Ver Mensaje
si quieres que quede arriba por que no z-index?

edito: espera creo que no lei bien quieres que solo se mueva al scrollear a los lados, sip es lo que te dijo isabelM
Creo que estaba en lo correcto y que falló al editar.

Bastaría con dar un valor a z-index mayor a #container que a #top para que en el desplazamiento vertical quede éste último sobre (eje z) #top.
  #9 (permalink)  
Antiguo 14/10/2011, 12:40
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

Cita:
Iniciado por kseso? Ver Mensaje
Creo que estaba en lo correcto y que falló al editar.

Bastaría con dar un valor a z-index mayor a #container que a #top para que en el desplazamiento vertical quede éste último sobre (eje z) #top.
aunque esa es un posibilidad, lo yo he entendido es que esté fixed horizontalmente y static verticalmente

si no es esto lo que quiere, está perdiendo el tiempo usando javascript
  #10 (permalink)  
Antiguo 14/10/2011, 14:36
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: barra fixed + desplazamiento horizontal

¿alguna razón para tener que complicarse cambiando sobre la marcha un valor de /position/ en función de que sea un desplazamiento u otro? ¿Y por qué a static (y sus "consecuencias") y no relative (y sus "ventajas")?

Si lo que he entendido (al scroll vertical que el #container no sea tapado por el #top) es correcto, sólo necesita colocarlo en el eje z (z-index) por debajo (el #top). Con ello no se sobrepone.
Y en el desplazamiento en x (horizontal) no habrá solapamiento puesto que inicialmente ya se colocan con una separación (en y).

Lo que me resulta sumamente llamativo es la cantidad de respuestas basadas en javaescript (o peor, en alguna de sus librerías) que últimamente se encuentran en el foro de css. Y la permanencia de esos temas en él "in saecula saeculorum".
  #11 (permalink)  
Antiguo 14/10/2011, 16:02
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

Cita:
Iniciado por kseso? Ver Mensaje
¿alguna razón para tener que complicarse cambiando sobre la marcha un valor de /position/ en función de que sea un desplazamiento u otro? ¿Y por qué a static (y sus "consecuencias") y no relative (y sus "ventajas")?
no conozco las consecuencias ni las ventajas, pero si tu lo dices será así

Cita:
Iniciado por kseso? Ver Mensaje
Si lo que he entendido (al scroll vertical que el #container no sea tapado por el #top) es correcto, sólo necesita colocarlo en el eje z (z-index) por debajo (el #top). Con ello no se sobrepone.
Y en el desplazamiento en x (horizontal) no habrá solapamiento puesto que inicialmente ya se colocan con una separación (en y).
eso es a lo que me refería. lo que dices es correcto si es lo que realmente busca. yo entendí otra cosas. te dejo un ejemplo de lo que yo entendí. habría que depurarlo
Cita:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="application/xhtml; charset=utf-8" />
<title></title>
<style type="text/css">
body {
background-color:#A3BEDC;
margin:0 auto 0 auto;
width:850px;
/*overflow-x: hidden;*/
}
img.title {
margin-top:7px;
margin-bottom:9px;
}
p {
text-align:left;
font-family: Tahoma;
font-size: 14px;
color: #214087;
text-indent:15px;
margin-top:0px;
}

/* DIVS */

#top {
border: 1px solid red;
width:850px;
background-color:#A3BEDC;
padding-top:10px;
clear:both;
height: 120px;
}

#container {
border: 1px solid yellow;
width:300%;
position:absolute;
top: 130px;
height: 1000px;
}
#menu {
margin-left:350px;
float:left;
}
.wrapper {
padding-top:130px;
width:500px;
}
#yo,#work,#form {
width:33.33%;
float:left;
}
/* FORM */

input[type=text] {
color:#214087;
font-size:12px;
text-shadow:1px 1px #fff;
}
input[type=text].name {
border:0;
background-color:#C6E2FF;
height:14px;
width:180px;
float:left;
padding:10px 10px 10px 10px;
}
input[type=text].email {
border:0;
background-color:#C6E2FF;
height:14px;
width:180px;
float:right;
padding:10px 10px 10px 10px;
}
textarea {
width:500px;
max-width:500px;
height:120px;
max-height:120px;
border:0;
background-color:#C6E2FF;
margin:20px 0;
padding:0;
font-family:Helvetica, Arial, sans-serif;
font-size:12px;
line-height:18px;
color:#574d4a;
text-shadow:1px 1px #fff;
}
input[type=submit].submit {
border:0;
color:#214087;
background-color:#C6E2FF;
height:30px;
width:80px;
float:right;
margin:0 0 0 20px;
}
</style>

<script type="text/javascript">
function GetZoomFactor () {
var factor = 1;
if (document.body.getBoundingClientRect) {
// rect is only in physical pixel size in IE before version 8
var rect = document.body.getBoundingClientRect ();
var physicalW = rect.right - rect.left;
var logicalW = document.body.offsetWidth;

// the zoom level is always an integer percent value
factor = Math.round ((physicalW / logicalW) * 100) / 100;
}
return factor;
}




function fnc() {

if ('pageXOffset' in window) { // todos excepto ie8-

if (window.pageXOffset >= 1 && window.pageYOffset == 0) {
document.getElementById('top').style.position = 'fixed';
document.getElementById('top').style.top = 0;
document.getElementById('top').style.marginLeft = parseInt(window.pageXOffset/500) + 'px';

} else if (window.pageXOffset >= 1 && window.pageYOffset <= 120) { // 120 es el alto de top
document.getElementById('top').style.position = 'fixed';
document.getElementById('top').style.top = - parseInt(window.pageYOffset) + 'px';
document.getElementById('top').style.marginLeft = parseInt(window.pageXOffset/500) + 'px';

}else {
document.getElementById('top').style.position = 'absolute';
document.getElementById('top').style.top = 0;
document.getElementById('top').style.marginLeft = parseInt(window.pageXOffset + (window.pageXOffset/500)) + 'px';
}



}else {
var zoomFactor = GetZoomFactor ();
var scrollTop = Math.round (document.documentElement.scrollTop / zoomFactor);
var scrollLeft = Math.round (document.documentElement.scrollLeft / zoomFactor);


if (scrollLeft >= 1 && scrollTop == 0) {
document.getElementById('top').style.position = 'fixed';
document.getElementById('top').style.top = 0;
document.getElementById('top').style.marginLeft = parseInt(scrollLeft/500) + 'px';

} else if (scrollLeft >= 1 && scrollTop <= 120) { // 120 es el alto de top
document.getElementById('top').style.position = 'fixed';
document.getElementById('top').style.top = - parseInt(scrollTop) + 'px';
document.getElementById('top').style.marginLeft = parseInt(scrollLeft/500) + 'px';

} else {
document.getElementById('top').style.position = 'absolute';
document.getElementById('top').style.top = 0;
document.getElementById('top').style.marginLeft = parseInt(scrollLeft + (scrollLeft/500)) + 'px';
}

}

}

window.onscroll = function() {fnc();};
</script>
</head>
<body>



<div id='top'>
<a href="http://www.martriay.com.ar"> <img src="images/logo.jpg" border="0" alt="Martin Triay" width="350" height="120" /> </a>
<div id='menu'>
<ul class='menu'>
<li><a href="#yo">Martin who?</a></li>
<li><a href="#work">Some of my work</a></li>
<li><a href="#form">Contact me!</a></li>
</ul>
</div>
</div>


<div id='container'>
<div id='yo'>
<div class='wrapper'>
<img class='title' src="images/martnwho.jpg" border="0" alt="Martin who?" align="bottom" width="170" height="30" />
<p>Hi, I'm Martin Triay, an argentinian web developer. I've been learning about web coding and designing by myself since I was 10. Now I'm 17 and still learning. Please keep in mind this site is still under construction.</p>
</div>
</div>
<div id='work'>
<div class='wrapper'>
<img class='title' src="images/smfmywrk.jpg" border="0" alt="Some of my work" align="bottom" width="220" height="30" />
<p>I like to work with valid <b>xHTML</b> + <b>CSS</b>, <b>JavaScript</b> (+<b>JQuery</b>), <b>AJAX</b> (XML + Javascript) and <b>PHP</b> + <b>MySQL</b>. I also work with CMS such as Joomla! or Wordpress.</p>
<p>What does this mean? It means that I can develop dynamic, fast and interactive sites which can also interact with databases.</p>
<p>I'm always looking for new projects to improve my abilities, taking every work as a new challenge to grow with. Would you like to see some of my work?</p>
<div id='slider'>
<a href="http://estudio-rh.com.ar" target="_blank">
<img src='images/estudio.jpg' width="400" height="300">
<span>
Estudio Rodr&iacute;guez Herrera
</span>
</a>
<a href="http://polimata.com.ar" target="_blank">
<img src='images/polimata.jpg' width="400" height="300">
<span>
Pol&iacute;mata
</span>
</a>
</div>
</div>
</div>
<div id='form'>
<div class='wrapper'>
<img class='title' src="images/contact.jpg" border="0" alt="Contact" align="bottom" width="120" height="30" />
<form method="post" action="send.php">
<input type="text" class="name" name="name" value="Who the hell are you?" onblur="if (this.value == '') {this.value = 'Who the hell are you?';}" onfocus="if (this.value == 'Who the hell are you?') {this.value = '';}"/>
<input type="text" class="email" name="mail" value="Email?" onblur="if (this.value == '') {this.value = 'Email?';}" onfocus="if (this.value == 'Email?') {this.value = '';}" />
<div class="clear"></div>
<textarea name="msg"></textarea>
<div class="clear"></div>
<input type="submit" value="Send" class="submit" />
<div class="clear"></div>
</form>
</div>
</div>
</div>


</body>
</html>
Cita:
Iniciado por kseso? Ver Mensaje
Lo que me resulta sumamente llamativo es la cantidad de respuestas basadas en javaescript (o peor, en alguna de sus librerías) que últimamente se encuentran en el foro de css. Y la permanencia de esos temas en él "in saecula saeculorum".
ya me estoy quitando pero en este caso, arreglo a lo que yo entendí, es la única solución que conozco. si por el contrario con css se puede lograr el mismo efecto que con javascript, te agradecería que lo postearas

Última edición por IsaBelM; 15/10/2011 a las 06:12 Razón: algo mas depurado
  #12 (permalink)  
Antiguo 15/10/2011, 06:48
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: barra fixed + desplazamiento horizontal

Cita:
Iniciado por IsaBelM Ver Mensaje
no conozco las consecuencias ni las ventajas, pero si tu lo dices será así
No, no es que lo diga yo. Lo definen los estándares. Quizás le sea de ayuda éste artículo de Mikmoro.

eso es a lo que me refería. lo que dices es correcto si es lo que realmente busca. yo entendí otra cosas. te dejo un ejemplo de lo que yo entendí. habría que depurarlo


ya me estoy quitando pero en este caso, arreglo a lo que yo entendí, es la única solución que conozco. si por el contrario con css se puede lograr el mismo efecto que con javascript, te agradecería que lo postearas
Ya lo indiqué en mi anterior comentario. Eso sí, en base a lo que he creído comprender. Porque no todas las respuestas han de ser en forma de código. Creo.
  #13 (permalink)  
Antiguo 15/10/2011, 14:16
Avatar de Martriay  
Fecha de Ingreso: noviembre-2010
Mensajes: 80
Antigüedad: 13 años, 5 meses
Puntos: 5
Respuesta: barra fixed + desplazamiento horizontal

Justamente, es lo que dijo isabel, quiero que sea static verticalmente mientras está fixed de forma horizontal. Ahora pruebo tu método.
  #14 (permalink)  
Antiguo 15/10/2011, 15:04
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: barra fixed + desplazamiento horizontal

Cita:
Iniciado por kseso? Ver Mensaje
No, no es que lo diga yo. Lo definen los estándares. Quizás le sea de ayuda éste artículo de Mikmoro.

no he sido mi intención poner en duda tal hecho. vasta que tú lo digas, para mi es así. en realidad cuando dije "static", me refería a que no fuera fixed. es decir (static, absolute o relative) que para el caso que ocupa, lo mismo da, que da lo mismo


Ya lo indiqué en mi anterior comentario. Eso sí, en base a lo que he creído comprender. Porque no todas las respuestas han de ser en forma de código. Creo.

a este respecto pensé que como tenemos interpretaciones distintas, cabía la posibilidad de que mi interpretación de lo que el usuario quiere, pudiera ser desarrollada en css en lugar de javascript. de ahí que te pidiera que postearas el código

Etiquetas: ancho, barra, contenido, desplazamiento, fixed, horizontal, html, fondo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:28.