Foros del Web » Programando para Internet » Javascript »

Marquesina continua ayuda.

Estas en el tema de Marquesina continua ayuda. en el foro de Javascript en Foros del Web. Estimados amigos, nuevamente una duda me trae hasta vuestro foro. Estoy realizando una web con coldfusion, en una zona de la web se muestran 7 ...
  #1 (permalink)  
Antiguo 04/03/2008, 09:43
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Exclamación Marquesina continua ayuda.

Estimados amigos, nuevamente una duda me trae hasta vuestro foro.

Estoy realizando una web con coldfusion, en una zona de la web se muestran 7 imágenes (fijas) recabadas de una base de datos.

El cliente pide que estas imágenes estén rotando, de manera que cuando la última imágen salga, la inmediatamente siguiente sea la primera y no espere que esta última desaparezca por el extremo de la marquesina.

Este efecto es el que no logro hacer, las imágenes pasan, pero no soy capaz de hacerlo.

Os pongo aquí el código que he hecho.

Código:
<script language="javascript1.2">

/*
cross browser marquee script- 
© dynamic drive (www.dynamicdrive.com)
for full source code, installation instructions,
100's more dhtml scripts, and terms of
use, visit dynamicdrive.com
*/


//specify the marquee's width (in pixels)
var marqueewidth=723
//specify the marquee's height (in pixels, pertains only to ns)
var marqueeheight=80
//specify the marquee's scroll speed (larger is faster)
var speed=6
//specify the marquee contents
var marqueecontents='';

marqueecontents += "<table border='0' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'><tr>";
	<cfif isDefined("selgal")>
		<cfoutput query="selgal">
		marqueecontents += "<td class='galeria'>";
		<cfif selgal.foto neq "">
			marqueecontents += "<div style='width:#application.escalaXgaleria#; height:#application.escalaYgaleria#; overflow:hidden;'><img src='colecciones/galeria/#selgal.foto#' border='0'></div>";
		<cfelse>
			marqueecontents += "<img src='img/blank1.gif' width='#application.escalaXgaleria#' height='#application.escalaYgaleria#' border='0'>";
		</cfif>
		marqueecontents += "</td>";
		</cfoutput>
		<cfif selgal.recordcount LT 7>
		<cfoutput>
			<cfloop index="indice" from="1" to="#7-selgal.recordcount#" step="1">
				marqueecontents+="<td class='galeria'><img src='img/blank1.gif' width='#application.escalaXgaleria#' height='#application.escalaYgaleria#' border='0'></td>
			</cfloop>
		</cfoutput>
		</cfif>		
	</cfif>	
	marqueecontents += "</tr></table>";
	
if (document.all)
document.write('<marquee scrollamount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>')

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
settimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
settimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.left=marqueewidth
scrollit()
}
}

window.onload=regenerate2
</script>


<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>

Este código funciona, es decir las imágenes pasan correctamente, pero no logro que sea de manera continua.

Espero que alguien pueda ayudarme ..

Un saludo a todos y muchas gracias.

He puesto este post en javascript, ya que, imagino que se resolverá con JavaScript y no con Coldfusion.

Saludos.
  #2 (permalink)  
Antiguo 04/03/2008, 09:47
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Marquesina continua ayuda.

Qué tal,

el script que estás usando inserta una marquesina html cuyo comportamiento es el que encuentras.

Hace algún tiempo hice un script que hace lo que creo que necesitas, mira a ver si te viene bien http://tunait.com/javascript/index.php?s=carousel

Si no, seguro deben haber por ahí a montones, tal vez alguien más pueda sugerirte más direcciones.

Un saludo
__________________
Javascript Códigos - Bambú difunde
  #3 (permalink)  
Antiguo 04/03/2008, 09:54
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

Gracias por tu pronta respuesta tunait ... viendo el script tendré que ir metiendo las imágenes en un array ... espero que así salga.

Lo voy a probar y si lo consigo, pongo el escript por aquí ... no obstante se aceptan más posibilidades .. por si las moscas

Muchas gracias tunait.
  #4 (permalink)  
Antiguo 04/03/2008, 10:10
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

He adaptado el script, introduciendo las imágenes en un array y aplicando el script de tunait, pero debo estar haciendo algo mal, tunait si ves algo raro y no te hace mucha molestia ... :-|

Un saludo!

Código:
<!---*****************************************************************************
Carousel de imágenes (marquesina horizontal). Script creado por Tunait! (18/8/2003) modificado el 25/12/2003.
Si quieres usar este script en tu sitio eres libre de hacerlo con la condición de que permanezcan intactas estas líneas, osea, los créditos.
No autorizo a publicar y ofrecer el código en sitios de script sin previa autorización
Si quieres publicarlo, por favor, contacta conmigo.
http://javascript.tunait.com/
[email protected] 
******************************************************************************--->
<script language="JavaScript" type="text/JavaScript">
	var ancho = 700 // especifica la anchura a mostrar
	var alto = 80 // especifica la altura a mostrar (alto de las imágenes)
	var velo = 10 // velocidad 
	var dis = 2 //cantidad de pixels que desplaza por movimiento
	
	var cont = 0
	var imagenes = new Array()
	
	<cfif isDefined("selgal")>
		<cfoutput query="selgal">
		<cfif selgal.foto neq "">
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/#selgal.foto#";
			cont=cont+1;
		<cfelse>
			imagenes[cont] = new Image()
			imagenes[cont].src = "img/blank1.gif"
			cont=cont+1;
		</cfif>
		</td>
		</cfoutput>
		<cfif selgal.recordcount LT 7>
		<cfoutput>
			<cfloop index="indice" from="1" to="#7-selgal.recordcount#" step="1">
				imagenes[cont] = new Image()
				imagenes[cont].src = "img/blank1.gif"
				cont=cont+1;
			</cfloop>
		</cfoutput>
		</cfif>
	</cfif>
	
var vel = velo
pasos = 4
var tot = 0
var tam =0;
var pos,pos2,tam2 =0;

function escribe(){
document.write ('<div id ="fuera" style="position:relative; width:' + ancho + 'px; height:' + alto + 'px;overflow:hidden">');
document.write ('<span id="imas" style="position:absolute; width:' + tam + 'px;height:' + alto + 'px; left = -' + tam + 'px;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0"  src ="' + imagenes[m].src + '" id="ima' + m + '" name="ima' + m + '"  onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('<span id="imas2" style="position:absolute; width:' + tam + 'px;height:' + alto + ';left=0;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0" src ="' + imagenes[m].src + '" id="imaa' + m + '" name="imaa' + m + '" onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('</div>');
}
var detienee = 0,posb,pos2b;
function mueve(){
pos = document.getElementById('imas').style.left;
pos2 = document.getElementById('imas2').style.left;
pos = pos.replace(/px/,"");
pos = pos.replace(/pt/,"");
pos = new Number(pos);
pos2 = pos2.replace(/px/,"");
pos2 = pos2.replace(/pt/,"");
pos2 = new Number(pos2);
if(detienee == 1){
	posb = pos;
	pos2b = pos2;
	}
if(atras == true){
pos-=dis;
pos2 -=dis;
}
else{
pos += dis;
pos2 += dis;
}
if(pos2 > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas2').style.left = pos  - (tam + dis);
		pos2 = document.getElementById('imas2').style.left;
		}
	else{
		document.getElementById('imas').style.left = pos 
		}
	}
else{
	document.getElementById('imas').style.left = pos 
	}

if(pos > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas').style.left = pos2 - (tam + dis);
		pos = document.getElementById('imas').style.left;
		}
	else{
		document.getElementById('imas2').style.left = pos2;
		}
	}
else{
	document.getElementById('imas2').style.left = pos2
	}
if(detienee > 0){
	if(detienee == pasos){
		vel = velo;
		atras = true;
		detienee--;
		tiempo = setTimeout('mueve()',vel);
		}
	else{
		if(atras == true){
			if(detienee>(pasos/2))
				{detienee--}
			else{
			vel = velo;
			clearTimeout(tiempo)
			}
			}
	else{
		detienee++
		}
	if(detienee > (pasos/2) && atras == false){vel +=10}
		if(detienee < (pasos/2)){vel +=10}
		tiempo = setTimeout('mueve()',vel)
		}
	}
else{
tiempo = setTimeout('mueve()',vel)
	}
if(atras == true){
		if (pos == posb){
			clearTimeout(tiempo);
			atras = false;
			}
		}
}
var tiempo;
var atras = false, ini;
function inicio(){
if(tot == (imagenes.length * 2)){clearTimeout(ini);reDimCapas();mueve()}
else{ini=setTimeout('inicio()',500)}
}
function reDimCapas(){
for(m=0;m<imagenes.length;m++){
	tam +=document.getElementById('ima'+m).width
	document.getElementById('imas').style.left = (-tam +10);
	document.getElementById('imas').style.width = tam ;
	document.getElementById('imas2').style.width = tam;
	}
}

</script>

<body onload="inicio();" >
<table width="51%" border="0" align="center">
  <tr>
    <td align="center">
<script>escribe();</script>
    </td>
  </tr>
</table>
</body>
Decir que este código está en un archivo llamado galeria.cfm, el cual está incluido en el principal (default.cfm) por si tuviera algo que ver ....

Un saludo.
  #5 (permalink)  
Antiguo 04/03/2008, 10:20
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Marquesina continua ayuda.

Pues habría de ver el código generado tal y como le llega al navegador pero así a ojo por lo que has dejado te faltan especificar algunos datos que luego el script va a buscar como el .a y el .target que, si no lo vas a usar debes dejar como un string vacío.

Pruébalo y me cuentas
  #6 (permalink)  
Antiguo 04/03/2008, 10:25
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

He puesto los strings vacíos en el .a y .target, pero sigue igual ... :-|

He copiado el código que se genera y es mucho ... pero lo pongo ahí

Es demasiado y me dice que no puedo postear tanto, lo haré en dos posts .....




Gracias por tu ayuda incondicional tunait.


Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">




<html>
<head>
	<title>MUEBLES BRIOLE - Estilo, calidad y dise&ntilde;o en todos nuestros productos.</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<link href="css/briole.css" rel="stylesheet" type="text/css" media="all">
	<meta http-equiv="imagetoolbar" content="no">
	<script language="JavaScript" src="js/briole.js"></script>
	<link rel="stylesheet" type="text/css" href="shadowbox/src/css/shadowbox.css">
	<script type="text/javascript" src="shadowbox/src/js/lib/yui-utilities.js"></script>
	<script type="text/javascript" src="shadowbox/src/js/adapter/shadowbox-yui.js"></script>
	<script type="text/javascript" src="shadowbox/src/js/shadowbox.js"></script>	
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table  width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">

<table width="900" border="0" bgcolor="silver" cellspacing="0" cellpadding="0">
  <tr>
    <td width="900" height="81" colspan="2" valign="bottom"><map name="Inicio">
<area alt="Inicio" coords="14,-4,210,29" href="default.cfm" target="_self">
</map>

<table width="900" height="81" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="3" valign="top" width="900" height="20"><img src="img/cabecera_01.jpg" width="900" height="20" alt="" vspace="0" hspace="0"></td>
	</tr>
	<tr>
		<td colspan="2" valign="top" width="450" height="32"><img src="img/cabecera_02.jpg" width="450" height="32" alt="" border="0" vspace="0" hspace="0" usemap="#Inicio"></td>
		<td background="img/cabecera_03.jpg" width="450" height="32" class="fuente_fecha" align="right" valign="middle" style="padding-right:15px" >
			<script>DiaSemana();tiempo();</script></td>
	</tr>
	<tr>
		<td valign="top" width="191" height="29"><img src="img/cabecera_04.jpg" width="191" height="29" alt="" vspace="0" hspace="0"></td>
		<td colspan="2" background="img/cabecera_05.jpg" width="709" height="29" valign="top"><table width="700" bgcolor="#0A87BE" cellpadding="0" cellspacing="0">
	<script language="JavaScript" type="text/javascript">
			ObjetoFlash("intro","flash/menu.swf",709,29,"transparent","");
	</script>
</table>
</td>
	</tr>
	<tr>
		<td valign="top" width="191" height="1"><img src="img/espacio.gif" width="191" height="1" alt="" vspace="0" hspace="0"></td>
		<td valign="top" width="259" height="1"><img src="img/espacio.gif" width="259" height="1" alt="" vspace="0" hspace="0"></td>
		<td valign="top" width="450" height="1"><img src="img/espacio.gif" width="450" height="1" alt="" vspace="0" hspace="0"></td>
	</tr>
</table></td>
  </tr>
  <tr>
    <td width="166"  rowspan="3" valign="top" bgcolor="#000286">  

<table  border="0" cellpadding="0" cellspacing="0">
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=1"><img src="colecciones/1_17.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Equipo de Descanso
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=4"><img src="colecciones/4_14.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Muebles de Diseño
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=3"><img src="colecciones/3_49.jpg" width="162" height="41" alt=""  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Mobiliario Juvenil
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=2"><img src="colecciones/2_1.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Línea Colonial
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=5"><img src="colecciones/5_40.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Rústico
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=6"><img src="colecciones/6_57.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Rústico Actual
		</td>
	</tr>
	
	
	<tr>
		<td rowspan="2">
			<img src="img/menu/mi_lateral01.jpg" width="4" height="57" alt="" ></td>
		<td>
			<div style="width:162; height:41; overflow:hidden;"><a href="default.cfm?ap=7"><img src="colecciones/7_20.jpg" width="162" height="41" alt=""  class="resalto" onmouseover="ilumina(this)" onmouseout="apaga(this)"  border="0"></a></div></td>
	</tr>
	<tr>
		<td background="img/menu/mi_azul01.jpg" width="162" height="16" class="texto_boton">
			Tapizados
		</td>
	</tr>
	
	
	
</table></td>
    <td width="728" bgcolor="#ffffff" valign="top">
	
		<table border="0" cellpadding="0" cellspacing="0">
			<tr><td height="314" width="728" align="right"><div style="padding-left:5px;padding-top:5px"> 
		 <table background="colecciones/fondos/3_49.jpg" border="0" cellspacing="0" cellpadding="0" height="314" width="728" style="background-repeat:no-repeat;">
		 <tr valign="top">
		 
		 	<td width="50%"></td>
		 
		 <td>
		 	
		 	<table border="0" cellspacing="20" cellpadding="10" width="364"><tr><td valign="top" class="tablacont">
				<div class="textocont">Líneas frescas, actuales y juveniles para los más jóvenes de la casa, y para los no tan jóvenes.</div>	
			</td></tr>
			</table>
			
		 </td>
		 
		 </tr>
		 </table>
	</div></td></tr>
		  	<tr><td height="80"><div style="padding-left:4px;padding-top:4px">
<head>
  #7 (permalink)  
Antiguo 04/03/2008, 10:26
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

Justo con lo anterior, aparece este otro trozo y que ya pertenece a la generación del vector de imágenes.

Código:
<script language="JavaScript" type="text/JavaScript">
	var ancho = 700 // especifica la anchura a mostrar
	var alto = 80 // especifica la altura a mostrar (alto de las imágenes)
	var velo = 10 // velocidad 
	var dis = 2 //cantidad de pixels que desplaza por movimiento
	
	var cont = 0
	var imagenes = new Array()
	
	
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/18_26.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/19_41.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/20_57.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/21_15.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/22_32.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/23_47.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/24_6.jpg"
			imagenes[cont].target = ""
			imagenes[cont].a = ""
			cont=cont+1;
		
		</td>
		
	
var vel = velo
pasos = 4
var tot = 0
var tam =0;
var pos,pos2,tam2 =0;

function escribe(){
document.write ('<div id ="fuera" style="position:relative; width:' + ancho + 'px; height:' + alto + 'px;overflow:hidden">');
document.write ('<span id="imas" style="position:absolute; width:' + tam + 'px;height:' + alto + 'px; left = -' + tam + 'px;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0"  src ="' + imagenes[m].src + '" id="ima' + m + '" name="ima' + m + '"  onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('<span id="imas2" style="position:absolute; width:' + tam + 'px;height:' + alto + ';left=0;"  onmouseover="if(detienee == 0){detienee = 1}" onmouseout="clearTimeout(tiempo);detienee=0;atras = false;vel=velo;mueve()">');
for (m=0;m<imagenes.length;m++){
	if(imagenes[m].a != ""){
		document.write('<a href="' + imagenes[m].a + '" target="' + imagenes[m].target + '">')
		}
	document.write ('<img border="0" src ="' + imagenes[m].src + '" id="imaa' + m + '" name="imaa' + m + '" onload="tot++;">');
	if(imagenes[m].a != ""){document.write ('</a>')}
	}
document.write ('</span>');
document.write ('</div>');
}
var detienee = 0,posb,pos2b;
function mueve(){
pos = document.getElementById('imas').style.left;
pos2 = document.getElementById('imas2').style.left;
pos = pos.replace(/px/,"");
pos = pos.replace(/pt/,"");
pos = new Number(pos);
pos2 = pos2.replace(/px/,"");
pos2 = pos2.replace(/pt/,"");
pos2 = new Number(pos2);
if(detienee == 1){
	posb = pos;
	pos2b = pos2;
	}
if(atras == true){
pos-=dis;
pos2 -=dis;
}
else{
pos += dis;
pos2 += dis;
}
if(pos2 > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas2').style.left = pos  - (tam + dis);
		pos2 = document.getElementById('imas2').style.left;
		}
	else{
		document.getElementById('imas').style.left = pos 
		}
	}
else{
	document.getElementById('imas').style.left = pos 
	}

if(pos > (ancho + dis)){
	if(detienee == 0){
		document.getElementById('imas').style.left = pos2 - (tam + dis);
		pos = document.getElementById('imas').style.left;
		}
	else{
		document.getElementById('imas2').style.left = pos2;
		}
	}
else{
	document.getElementById('imas2').style.left = pos2
	}
if(detienee > 0){
	if(detienee == pasos){
		vel = velo;
		atras = true;
		detienee--;
		tiempo = setTimeout('mueve()',vel);
		}
	else{
		if(atras == true){
			if(detienee>(pasos/2))
				{detienee--}
			else{
			vel = velo;
			clearTimeout(tiempo)
			}
			}
	else{
		detienee++
		}
	if(detienee > (pasos/2) && atras == false){vel +=10}
		if(detienee < (pasos/2)){vel +=10}
		tiempo = setTimeout('mueve()',vel)
		}
	}
else{
tiempo = setTimeout('mueve()',vel)
	}
if(atras == true){
		if (pos == posb){
			clearTimeout(tiempo);
			atras = false;
			}
		}
}
var tiempo;
var atras = false, ini;
function inicio(){
if(tot == (imagenes.length * 2)){clearTimeout(ini);reDimCapas();mueve()}
else{ini=setTimeout('inicio()',500)}
}
function reDimCapas(){
for(m=0;m<imagenes.length;m++){
	tam +=document.getElementById('ima'+m).width
	document.getElementById('imas').style.left = (-tam +10);
	document.getElementById('imas').style.width = tam ;
	document.getElementById('imas2').style.width = tam;
	}
}

</script>
</head>
<body onload="inicio();">
<table width="51%" border="0" align="center">
  <tr>
    <td align="center">
		<script>escribe();</script>
    </td>
  </tr>
</table>
</body></div></td></tr>
		</table>
	
 		
  	</td>
 
</table>
</td>
</tr>
<tr>
    <td colspan="3" align="center" valign="top"><table border="0" cellspacing="2" cellpadding="2">
<tr><td class="fuente_pie" colspan="9" align="center">Copyright &copy 2008 Muebles Briole</td></tr>
<tr align="center">
		<td><a href="empresa.cfm">La Empresa</a></td>
		<td class="fuente_pie">|</td>
		<td><a href="ubicacion.cfm">D&oacute;nde Estamos</a></td>
		<td class="fuente_pie">|</td>
		<td><a href="servicios.cfm">Qu&eacute; Ofrecemos</a></td>
		<td class="fuente_pie">|</td>
		<td><a href="spot.cfm">Spot</a></td>
		<td class="fuente_pie">|</td>
		<td><a href="contacta.cfm">Contacta</a></td>
	</tr>
	<tr><td align="center" colspan="9" class="optimizado">Sitio web Optimizado para: MS Internet Explorer 6 y 7 - Flash Player 8 - Resolución de 1024x768 p&iacute;xeles<br><br>
			<a href="http://www.pikolin.es" target="_blank" title="Visitar web PIKOLIN"><img src="img/logo.gif" width="92" height="31" border="0"></a>
	</td></tr>
</table>
	</td>
  </tr>
</table>
</body>
</html>
  #8 (permalink)  
Antiguo 04/03/2008, 10:29
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

Tunait! no te molestes!!!!! ya me ha salido, el error es que me había dejado un </td> suelto por ahí y estaba metiendo la gamba, me he dado cuenta al ver el código generado.

Gracias por tu ayuda, eres una máquina.

Miles de gracias, estoy super agradecida!!!!!!!!!!!!
  #9 (permalink)  
Antiguo 04/03/2008, 10:33
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Marquesina continua ayuda.

Se te están colando unos cierres de celda html dentro del área del código javascript. Eso te está disparando errores y todo se detiene. Revísalo


Código:
<cfif isDefined("selgal")>
		<cfoutput query="selgal">
		<cfif selgal.foto neq "">
			imagenes[cont] = new Image()
			imagenes[cont].src = "colecciones/galeria/#selgal.foto#";
			cont=cont+1;
		<cfelse>
			imagenes[cont] = new Image()
			imagenes[cont].src = "img/blank1.gif"
			cont=cont+1;
		</cfif>
		</td>
		</cfoutput>
		<cfif selgal.recordcount LT 7>
		<cfoutput>
			<cfloop index="indice" from="1" to="#7-selgal.recordcount#" step="1">
				imagenes[cont] = new Image()
				imagenes[cont].src = "img/blank1.gif"
				cont=cont+1;
			</cfloop>
		</cfoutput>
		</cfif>
	</cfif>
Debes borrar lo que te marco en rojo
  #10 (permalink)  
Antiguo 04/03/2008, 10:44
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

Exacto! Eso era, ahora rula de maravilla ....

Una dudilla ... para que las imágenes aparezcan separadas unas de otras y no pegadas, imagino que habrá que modificar la función escribe(), lo que no sé es dónde ...

De todas maneras es secundario, bastante murga te he dado ya ....
  #11 (permalink)  
Antiguo 04/03/2008, 10:57
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Marquesina continua ayuda.

mmm ... puedes hacerlo más sencillo. Aplícale un margen a algún lado a las imágenes con css

Código HTML:
<style type="text/css">
#fuera img{
	margin-left: 5px;
}
</style> 
y la misma cantidad (5 en el ejemplo) la has de sumar en la última función del script

Código:
function reDimCapas(){
for(m=0;m<imagenes.length;m++){
	tam +=document.getElementById('ima'+m).width + 5
	document.getElementById('imas').style.left = (-tam +10);
	document.getElementById('imas').style.width = tam ;
	document.getElementById('imas2').style.width = tam;
	}
}
Con eso debería bastar
  #12 (permalink)  
Antiguo 04/03/2008, 11:11
Avatar de mariamm_  
Fecha de Ingreso: enero-2005
Mensajes: 124
Antigüedad: 19 años, 4 meses
Puntos: 1
Re: Marquesina continua ayuda.

Lo dicho ... una máquina ...

Gracias de nuevo!
  #13 (permalink)  
Antiguo 04/03/2008, 11:40
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Re: Marquesina continua ayuda.

De nada me alegra que lo solucionaras
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 08:54.