Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

kbssa

Slide Show em javascript sendo alimentado em asp

Recommended Posts

entao galera oia eu aqui denovo

o seguinte tenho em javascript um slide show soh q esses dados do slide show eu queria alimentar ele com dados vindos da tabela do banco

 

tipo tentei com response.write()

mais nao vai

 

o codigo do slide show

<script>var SlideShowSpeed = 5000;var CrossFadeDuration = 3;var Menu = new Array(); var Picture = new Array();var Titulo = new Array();var Caption = new Array();Menu[1]  = 'destaque/menu001.jpg';Menu[2]  = 'destaque/menu002.jpg';Menu[3]  = 'destaque/menu003.jpg';Menu[4]  = 'destaque/menu004.jpg';Picture[1]  = 'destaque/Image002.jpg';Picture[2]  = 'destaque/Image002.jpg';Picture[3]  = 'destaque/Image003.jpg';Picture[4]  = 'destaque/Image004.jpg';Titulo[1]  = "Futebol";Titulo[2]  = "Papa";Titulo[3]  = "Musica";Titulo[4]  = "Tecnologia";Caption[1]  = "Grêmio vence o Cerro Porteñoe avança na Libertadores";Caption[2]  = "SP: relógio de quatro toneladas é instalado em Aparecida";Caption[3]  = "Lily Allen: principais atrações do festival Coachella 2007";Caption[4]  = "Robô japonês consegue carregar caixa de 30 kg";var tss;var iss;var tssMenu;var issMenu;var jss = 1;var pss = Picture.length-1;var pssMenu = Menu.length-1;var preLoad = new Array();for (iss = 1; iss < pss+1; iss++){preLoad[iss] = new Image();preLoad[iss].src = Picture[iss];}var preLoadMenu = new Array();for (issMenu = 1; issMenu < pssMenu+1; issMenu++){preLoadMenu[issMenu] = new Image();preLoadMenu[issMenu].src = Menu[issMenu];}function runSlideShow(){	if (document.all){		document.images.PictureBox.style.filter="blendTrans(duration=2)";		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";		document.images.PictureBox.filters.blendTrans.Apply();	}	if (document.all){		document.images.MenuBox.style.filter="blendTrans(duration=2)";		document.images.MenuBox.style.filter="blendTrans(duration=CrossFadeDuration)";		document.images.MenuBox.filters.blendTrans.Apply();	}	document.images.PictureBox.src = preLoad[jss].src;	document.images.MenuBox.src = preLoadMenu[jss].src;			if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];	if (document.getElementById) document.getElementById("TituloBox").innerHTML= Titulo[jss];	if (document.all) document.images.PictureBox.filters.blendTrans.Play();	if (document.all) document.images.MenuBox.filters.blendTrans.Play();	jss = jss + 1;	if (jss > (pss)) jss=1;		tss = setTimeout('runSlideShow()', SlideShowSpeed);}</script><link href="estilo/estilo.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style1 {	color: #FFFFFF;	font-weight: bold;}--></style></head><body onload=runSlideShow()><table width="450" height="175" border=0 cellpadding=0 cellspacing=0>  <tr>	<td width=450 valign="top" background="images/destaque.jpg">	  <table width="450" height="158" border="0" cellpadding="2" cellspacing="2">		<tr>		  <td width="202" height="140" align="center" valign="bottom"><div align="center"><img src="destaque/carregando.jpg" name=PictureBox width=185 height=120 border="5" style="border-color:#FFFFFF; "></div></td>		  <td width="234" rowspan="2" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="TextoPadrao">			<tr>				  <td height="13" align=left id=TituloBox style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;">				</div></td>			</tr>			<tr>				  <td height="40" align=left style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;" id=CaptionBox>					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold; height:40px">				</div></td>			</tr>			<tr>			  <td height="57" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">Cidades </div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"> Em terceiro filme, Homem-Aranha enfrenta três vilões.</div></td>				</tr>			  </table></td>			</tr>			<tr>			  <td height="52" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">Cidades </div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"> Em terceiro filme, Homem-Aranha enfrenta três vilões.</div></td>				</tr>			  </table></td>			</tr>		  </table></td>		</tr>		<tr>		  <td valign="top"><div align="center"><img src="destaque/menu.jpg" name=MenuBox width=201 height=22 ></div></td>		</tr>	  </table>	 </td>  </tr>  <tr>  </tr></table>

o codigo que tentei alimentar com dados da tabela

 

<%Set rs = Server.CreateObject("ADODB.Recordset")rs.CursorType = adOpenKeysetrs.Open "SELECT * FROM tab_noticia WHERE data_noticia <= NOW ORDER BY id_noticia DESC", Conexao ,3,3response.Write("<script>")response.Write("var SlideShowSpeed = 5000;")response.Write("var CrossFadeDuration = 3;")response.Write("var Menu = new Array();")response.Write("var Picture = new Array();")response.Write("var Titulo = new Array();")response.Write("var Caption = new Array();")response.Write("Menu[1]  = 'destaque/menu001.jpg';")response.Write("Menu[2]  = 'destaque/menu002.jpg';")response.Write("Menu[3]  = 'destaque/menu003.jpg';")response.Write("Menu[4]  = 'destaque/menu004.jpg';")for x = 1 to 4	response.Write("Picture["&x&"] = '"&rs.fields("img_noticia")&"';")	response.Write("Titulo["&x&"] = '"&rs.fields("titulo_noticia")&"';")	response.Write("Caption["&x&"] = '"&left(rs.fields("desc_noticia"),200)&"';")	rs.movenextnextresponse.Write("var tss;")response.Write("var iss;")response.Write("var tssMenu;")response.Write("var issMenu;")response.Write("var jss = 1;")response.Write("var pss = Picture.length-1;")response.Write("var pssMenu = Menu.length-1;")response.Write("var preLoad = new Array();")response.Write("for (iss = 1; iss < pss+1; iss++){")response.Write("preLoad[iss] = new Image();")response.Write("preLoad[iss].src = Picture[iss];}")response.Write("var preLoadMenu = new Array();")response.Write("for (issMenu = 1; issMenu < pssMenu+1; issMenu++){")response.Write("preLoadMenu[issMenu] = new Image();")response.Write("preLoadMenu[issMenu].src = Menu[issMenu];}")response.Write("function runSlideShow(){")response.Write("	if (document.all){")response.Write("		document.images.PictureBox.style.filter='blendTrans(duration=2)';")response.Write("		document.images.PictureBox.style.filter='blendTrans(duration=CrossFadeDuration)';")response.Write("		document.images.PictureBox.filters.blendTrans.Apply();")response.Write("	}")response.Write("	if (document.all){")response.Write("		document.images.MenuBox.style.filter='blendTrans(duration=2)';")response.Write("		document.images.MenuBox.style.filter='blendTrans(duration=CrossFadeDuration)';")response.Write("		document.images.MenuBox.filters.blendTrans.Apply();")response.Write("	}")	response.Write("	document.images.PictureBox.src = preLoad[jss].src;")response.Write("	document.images.MenuBox.src = preLoadMenu[jss].src;	")	response.Write("	if (document.getElementById) document.getElementById('CaptionBox').innerHTML= Caption[jss];")response.Write("	if (document.getElementById) document.getElementById('TituloBox').innerHTML= Titulo[jss];")response.Write("	if (document.all) document.images.PictureBox.filters.blendTrans.Play();")response.Write("	if (document.all) document.images.MenuBox.filters.blendTrans.Play();")response.Write("	jss = jss + 1;")response.Write("	if (jss > (pss)) jss=1;")response.Write("		tss = setTimeout('runSlideShow()', SlideShowSpeed);")response.Write("}")response.Write("</script>")%><link href="estilo/estilo.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style1 {	color: #FFFFFF;	font-weight: bold;}--></style></head><body onload=runSlideShow()><table width="450" height="175" border=0 cellpadding=0 cellspacing=0>  <tr>	<td width=450 valign="top" background="images/destaque.jpg">	  <table width="450" height="158" border="0" cellpadding="2" cellspacing="2">		<tr>		  <td width="202" height="140" align="center" valign="bottom"><div align="center"><img src="destaque/carregando.jpg" name=PictureBox width=185 height=120 border="5" style="border-color:#FFFFFF; "></div></td>		  <td width="234" rowspan="2" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="TextoPadrao">			<tr>				  <td height="13" align=left id=TituloBox style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;">				</div></td>			</tr>			<tr>				  <td height="40" align=left style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;" id=CaptionBox>					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold; height:40px">				</div></td>			</tr>			<tr>			  <td height="57" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">Cidades </div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"> Em terceiro filme, Homem-Aranha enfrenta três vilões.</div></td>				</tr>			  </table></td>			</tr>			<tr>			  <td height="52" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">Cidades </div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"> Em terceiro filme, Homem-Aranha enfrenta três vilões.</div></td>				</tr>			  </table></td>			</tr>		  </table></td>		</tr>		<tr>		  <td valign="top"><div align="center"><img src="destaque/menu.jpg" name=MenuBox width=201 height=22 ></div></td>		</tr>	  </table>	 </td>  </tr>  <tr>  </tr></table>

se alguem tiver uma dica ou saber o q estou fazendo de errado da um toque ae fico muito grato

 

vlw

Compartilhar este post


Link para o post
Compartilhar em outros sites

cara da uma olhada nesse do TmFerreira! um dos melhores que já vi!

 

<html>	<head>		<title>S l i d e S h o w - by tmferreira</title>		<style><!--			* {				margin: 0;				padding: 0;				list-style: none;				text-decoration: none;				font-family: Verdana, Arial, Helvetica, Sans-Serif;			}			div#slideshow {				height: 250px;				width: 500px;				border: 1px solid black;			}			div#slideshow #links {				float: right;				clear: both;				width: 10%;				text-align: center;			}			div#slideshow #links li {				font-size: 12px;				border-top: 1px solid white;				line-height: 49px;			}			div#slideshow #links li.inativo {				background: #EEEEEE;			}			div#slideshow #links li.ativo {				background: #D9D9D9;			}			div#slideshow #slides {				background: #BBBBBB;				height: 100%;				color: white;				font-size: 14px;			}			div#slideshow #slides .visible {				display: block;			}			div#slideshow #slides .hidden {				display: none;			}			div#slideshow #slides div span {				display: block;			}			div#slideshow #slides .titulo{				font-weight: bold;				font-size: 16px;				padding: 5px 0 0 5px;			}			div#slideshow #slides .conteudo {				padding: 0 0 0 5px;			}		--></style>		<script type="text/javascript">			var tempo;			var intervalo = 2000; //Intervalo entra as mudanças de slides. Definido em milisegundos.			function $(campo) {				return document.getElementById(campo);			}			//Trecho de código criado por Wilker, pego em http://forum.imasters.com.br/index.php?s=&showtopic=198704&view=findpost&p=660522			var $A = Array.from = function(iterable) {				if (!iterable) return [];				if (iterable.toArray) {					return iterable.toArray();				} else {					var results = [];					for (var i = 0; i < iterable.length; i++)						results.push(iterable[i]);					return results;				}			};			Function.prototype.bind = function() {				var __method = this, args = $A(arguments), object = args.shift();				return function() {					return __method.apply(object, args.concat($A(arguments)));				};			};			//Fim do trecho de código criado por Wilker			function addEvent(obj, evType, fn) { //Função adaptada da original de Christian Heilmann, em http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html				if (typeof obj == "string") {					if (null == (obj = document.getElementById(obj))) {						throw new Error("Elemento HTML não encontrado. Não foi possível adicionar o evento.");					}				}				if (obj.attachEvent) {					return obj.attachEvent(("on" + evType), fn);				} else if (obj.addEventListener) {					return obj.addEventListener(evType, fn, true);				} else {					throw new Error("Seu browser não suporta adição de eventos.");				}			}			function nextSlide() {				var divs = $('slides').getElementsByTagName('div');				var i;				for (i = 0; i < divs.length; i++) {					if (divs[i].className == 'visible') {						divs[i].className = 'hidden';						$('link' + (i + 1)).className = 'inativo'						i = (i == divs.length - 1) ? 0 : i + 1;						divs[i].className = 'visible';						$('link' + (i + 1)).className = 'ativo'						break;					}				}			}			function init() {				var as = $('links').getElementsByTagName('a');				var i;				for (i = 0; i < as.length; i++) {					var f = function(v) {						setSlide(as[v]);					}					addEvent(as[i], 'click', f.bind(this, i));				}				tempo = setInterval('nextSlide()', intervalo);			}			function setSlide(link) {				var divs = $('slides').getElementsByTagName('div');				var i;				for (i = 0; i < divs.length; i++) {					divs[i].className = 'hidden';				}				var lis = $('links').getElementsByTagName('li');				for (i = 0; i < lis.length; i++) {					lis[i].className = 'inativo';				}				link.parentNode.className = 'ativo';				i = parseInt(link.firstChild.data);				$('slide' + i).className = 'visible';				clearInterval(tempo);			}			addEvent(window, 'load', init);		</script>	</head>	<body>		<div id="slideshow" name="slideshow">			<div id="links" name="links">				<ul>					<li id="link1" name="link1" class="ativo"><a href="#">1</a></li>					<li id="link2" name="link2" class="inativo"><a href="#">2</a></li>					<li id="link3" name="link3" class="inativo"><a href="#">3</a></li>					<li id="link4" name="link4" class="inativo"><a href="#">4</a></li>					<li id="link5" name="link5" class="inativo"><a href="#">5</a></li>				</ul>			</div>			<div id="slides" name="slides">				<div id="slide1" name="slide1" class="visible">					<span class="titulo">Título 1</span>					<span class="conteudo"><img src="logo.jpg" width="100px" height="100px" style="float:left; margin: 8px; margin-left: 0;" />Lorem ipsum dolor lorem ipsum dolor amet sit crustaceous, carpe diem est im corpus writ. Habeus corpus semper fidelus dolor amet lorem carpe diem est im corpus writ. Lorem ipsum dolor lorem ipsum dolor amet sit crustaceous, carpe diem est im corpus writ. Habeus corpus semper fidelus dolor amet lorem carpe diem est im corpus writ.					<br />					Lorem ipsum dolor lorem ipsum dolor amet sit crustaceous, carpe diem est im corpus writ. Habeus corpus semper fidelus dolor amet lorem carpe diem est im corpus writ. Lorem ipsum dolor lorem ipsum dolor amet sit crustaceous, carpe diem est im corpus writ.					</span>				</div>				<div id="slide2" name="slide2" class="hidden">					<span class="titulo">Título 2</span>					<span class="conteudo"><img src="logo.jpg" width="100px" height="100px" style="float:left; margin: 8px; margin-left: 0;" />Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.					</span>				</div>				<div id="slide3" name="slide3" class="hidden">					<span class="titulo">Título 3</span>					<span class="conteudo"><img src="logo.jpg" width="100px" height="100px" style="float:left; margin: 8px; margin-left: 0;" />It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).					</span>				</div>				<div id="slide4" name="slide4" class="hidden">					<span class="titulo">Título 4</span>					<span class="conteudo"><img src="logo.jpg" width="100px" height="100px" style="float:left; margin: 8px; margin-left: 0;" />There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable.					</span>				</div>				<div id="slide5" name="slide5" class="hidden">					<span class="titulo">Título 5</span>					<span class="conteudo"><img src="logo.jpg" width="100px" height="100px" style="float:left; margin: 8px; margin-left: 0;" />Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC.					</span>				</div>			</div>		</div>	</body></html>
aqui:

<ul>					<li id="link1" name="link1" class="ativo"><a href="#">1</a></li>					<li id="link2" name="link2" class="inativo"><a href="#">2</a></li>					<li id="link3" name="link3" class="inativo"><a href="#">3</a></li>					<li id="link4" name="link4" class="inativo"><a href="#">4</a></li>					<li id="link5" name="link5" class="inativo"><a href="#">5</a></li>				</ul>

você adapta dinamicamente

 

e aqui:

<div id="slide1" name="slide1" class="visible">

também!

com um loop!

 

ABraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

pow kra vlw pela atenção mais ja vi este script mais para adaptar pro meu layout acho q vai ficar meio complicadoja tentei adapta-lo massssss sem sucessoda um bico no meuwww.acessoregional.com.br/destaque.aspvlw

Compartilhar este post


Link para o post
Compartilhar em outros sites

já tentou criar o array do javascript dentro do asp dinamicamente? é pra funcionar

Compartilhar este post


Link para o post
Compartilhar em outros sites

entao kra o problema esta ae nao sei como montar esse array no asp tentei com o response.write igual mostrei no segundo codigo do primeiro posto tipo da um erro na paginana descrição do erro aparece Objeto esperadoeu mando exibir o codigo fonte da pagina e mostra todos os dados certinho vindo do banco de dados mais nao exibe no slide manjatipo como eu monto esse array dentro do aspwww.acessoregional.com.br/destaque1.aspde um bico eh esse o tal arquivose olhar no codigo fonte da pagina gerada se vai ve os dados tudo certinho soh falta mostrar na telavlw pela atenção

Compartilhar este post


Link para o post
Compartilhar em outros sites

seguinte....pra facilitar na comparação coloquei entre uma linha e outra response.write(vbnewline), isso vai dar uma nova linha no codigo javascript. Percebi que o array Picture tem uma string entre aspas simples e os arrays Titulo e Caption entre aspas duplas

Fiz a modificação no asp, veja se dá algum resultado

<%Set rs = Server.CreateObject("ADODB.Recordset")rs.CursorType = adOpenKeysetrs.Open "SELECT * FROM tab_noticia WHERE data_noticia <= NOW ORDER BY id_noticia DESC", Conexao ,3,3response.Write("<script>")Response.Write(vbnewline)response.Write("var SlideShowSpeed = 5000;")Response.Write(vbnewline)response.Write("var CrossFadeDuration = 3;")Response.Write(vbnewline)response.Write("var Menu = new Array();")Response.Write(vbnewline)response.Write("var Picture = new Array();")Response.Write(vbnewline)response.Write("var Titulo = new Array();")Response.Write(vbnewline)response.Write("var Caption = new Array();")Response.Write(vbnewline)response.Write("Menu[1]  = 'destaque/menu001.jpg';")Response.Write(vbnewline)response.Write("Menu[2]  = 'destaque/menu002.jpg';")Response.Write(vbnewline)response.Write("Menu[3]  = 'destaque/menu003.jpg';")Response.Write(vbnewline)response.Write("Menu[4]  = 'destaque/menu004.jpg';")Response.Write(vbnewline)for x = 1 to 4	pic = pic & vbnewline & "Picture["&x&"] = '"&rs.fields("img_noticia")&"';"	tit = tit & vbnewline & "Titulo["&x&"] = """&rs.fields("titulo_noticia")&""";"	cap = cap & vbnewline & "Caption["&x&"] = """&left(rs.fields("desc_noticia"),200)&""";"	rs.movenextnextResponse.Write(pic)Response.Write(tit)Response.Write(cap)Response.Write(vbnewline)response.Write("var tss;")Response.Write(vbnewline)response.Write("var iss;")Response.Write(vbnewline)response.Write("var tssMenu;")Response.Write(vbnewline)response.Write("var issMenu;")Response.Write(vbnewline)response.Write("var jss = 1;")Response.Write(vbnewline)response.Write("var pss = Picture.length-1;")Response.Write(vbnewline)response.Write("var pssMenu = Menu.length-1;")Response.Write(vbnewline)response.Write("var preLoad = new Array();")Response.Write(vbnewline)response.Write("for (iss = 1; iss < pss+1; iss++){")Response.Write(vbnewline)response.Write("preLoad[iss] = new Image();")Response.Write(vbnewline)response.Write("preLoad[iss].src = Picture[iss];}")Response.Write(vbnewline)response.Write("var preLoadMenu = new Array();")Response.Write(vbnewline)response.Write("for (issMenu = 1; issMenu < pssMenu+1; issMenu++){")Response.Write(vbnewline)response.Write("preLoadMenu[issMenu] = new Image();")Response.Write(vbnewline)response.Write("preLoadMenu[issMenu].src = Menu[issMenu];}")Response.Write(vbnewline)response.Write("function runSlideShow(){")Response.Write(vbnewline)response.Write("	if (document.all){")Response.Write(vbnewline)response.Write("		document.images.PictureBox.style.filter='blendTrans(duration=2)';")Response.Write(vbnewline)response.Write("		document.images.PictureBox.style.filter='blendTrans(duration=CrossFadeDuration)';")Response.Write(vbnewline)response.Write("		document.images.PictureBox.filters.blendTrans.Apply();")Response.Write(vbnewline)response.Write("	}")Response.Write(vbnewline)response.Write("	if (document.all){")Response.Write(vbnewline)response.Write("		document.images.MenuBox.style.filter='blendTrans(duration=2)';")Response.Write(vbnewline)response.Write("		document.images.MenuBox.style.filter='blendTrans(duration=CrossFadeDuration)';")Response.Write(vbnewline)response.Write("		document.images.MenuBox.filters.blendTrans.Apply();")Response.Write(vbnewline)response.Write("	}")Response.Write(vbnewline)	response.Write("	document.images.PictureBox.src = preLoad[jss].src;")Response.Write(vbnewline)response.Write("	document.images.MenuBox.src = preLoadMenu[jss].src;	")Response.Write(vbnewline)	response.Write("	if (document.getElementById) document.getElementById('CaptionBox').innerHTML= Caption[jss];")Response.Write(vbnewline)response.Write("	if (document.getElementById) document.getElementById('TituloBox').innerHTML= Titulo[jss];")Response.Write(vbnewline)response.Write("	if (document.all) document.images.PictureBox.filters.blendTrans.Play();")Response.Write(vbnewline)response.Write("	if (document.all) document.images.MenuBox.filters.blendTrans.Play();")Response.Write(vbnewline)response.Write("	jss = jss + 1;")Response.Write(vbnewline)response.Write("	if (jss > (pss)) jss=1;")Response.Write(vbnewline)response.Write("		tss = setTimeout('runSlideShow()', SlideShowSpeed);")Response.Write(vbnewline)response.Write("}")Response.Write(vbnewline)response.Write("</script>")%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

entao tentei com esse codigo q você montou e nao funfouto tentando ainda mais ateh agora sem sucessovlw pela ajuda ae t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

depois de executar você visualizou o codigo fonte do browser para comparar as funções javascript?

Compartilhar este post


Link para o post
Compartilhar em outros sites

parece q estamos quase solucionando esta questao

tipo fiz da seguinte maneira

 

fui adicionando os campos Picture, Titulo e Caption um de cada vez e descobri q o erro ocorre no campo Caption

tentei de varias formas mais nao consegui

o campo da imagem e do titulo foi sussa sem nenhum erro

dae quanto tento adionar o campo caption q occore o erro

 

 

 

acabei de consegui

kkkkkkk

ufa

 

entao tipo diminui o numero de caracter no campo Caption e bingo funfou

agora nao se se tem a ve mais funcionou

segue o codigo fonte dele solucionado pra galera que quizer usar

vlw

 

<!--#include file="painel/conexao.asp"--><%Set rs = Server.CreateObject("ADODB.Recordset")rs.CursorType = adOpenKeysetrs.Open "SELECT * FROM tab_noticia WHERE data_noticia <= NOW ORDER BY id_noticia DESC", Conexao ,3,3Response.Write("<script>")Response.Write(vbnewline)Response.Write("var SlideShowSpeed = 5000;")Response.Write(vbnewline)Response.Write("var CrossFadeDuration = 3;")Response.Write(vbnewline)Response.Write("var Menu = new Array(); ")Response.Write(vbnewline)Response.Write("var Picture = new Array();")Response.Write(vbnewline)Response.Write("var Titulo = new Array();")Response.Write(vbnewline)Response.Write("var Caption = new Array();")Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("Menu[1]  = 'destaque/menu001.jpg';")Response.Write(vbnewline)Response.Write("Menu[2]  = 'destaque/menu002.jpg';")Response.Write(vbnewline)Response.Write("Menu[3]  = 'destaque/menu003.jpg';")Response.Write(vbnewline)Response.Write("Menu[4]  = 'destaque/menu004.jpg';")Response.Write(vbnewline)Response.Write(vbnewline)for x = 1 to 4	pic = pic & vbnewline & "Picture["&x&"] = '"&rs.fields("img_noticia")&"';"	tit = tit & vbnewline & "Titulo["&x&"] = """&rs.fields("tipo_noticia")&""";"	cap = cap & vbnewline & "Caption["&x&"] = """&left(rs.fields("desc_noticia"),40)&"..."";"	rs.movenextnextResponse.Write(pic)Response.Write(vbnewline)Response.Write(vbnewline)Response.Write(tit)Response.Write(vbnewline)Response.Write(vbnewline)Response.Write(cap)Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("var tss;")Response.Write(vbnewline)Response.Write("var iss;")Response.Write(vbnewline)Response.Write("var tssMenu;")Response.Write(vbnewline)Response.Write("var issMenu;")Response.Write(vbnewline)Response.Write("var jss = 1;")Response.Write(vbnewline)Response.Write("var pss = Picture.length-1;")Response.Write(vbnewline)Response.Write("var pssMenu = Menu.length-1;")Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("var preLoad = new Array();")Response.Write(vbnewline)Response.Write("for (iss = 1; iss < pss+1; iss++){")Response.Write(vbnewline)Response.Write("preLoad[iss] = new Image();")Response.Write(vbnewline)Response.Write("preLoad[iss].src = Picture[iss];}")Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("var preLoadMenu = new Array();")Response.Write(vbnewline)Response.Write("for (issMenu = 1; issMenu < pssMenu+1; issMenu++){")Response.Write(vbnewline)Response.Write("preLoadMenu[issMenu] = new Image();")Response.Write(vbnewline)Response.Write("preLoadMenu[issMenu].src = Menu[issMenu];}")Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("function runSlideShow(){")Response.Write(vbnewline)Response.Write("	if (document.all){")Response.Write(vbnewline)Response.Write("		document.images.PictureBox.style.filter=""blendTrans(duration=2)"";")Response.Write(vbnewline)Response.Write("		document.images.PictureBox.style.filter=""blendTrans(duration=CrossFadeDuration)"";")Response.Write(vbnewline)Response.Write("		document.images.PictureBox.filters.blendTrans.Apply();")Response.Write(vbnewline)Response.Write("	}")Response.Write(vbnewline)Response.Write("	if (document.all){")Response.Write(vbnewline)Response.Write("		document.images.MenuBox.style.filter=""blendTrans(duration=2)"";")Response.Write(vbnewline)Response.Write("		document.images.MenuBox.style.filter=""blendTrans(duration=CrossFadeDuration)"";")Response.Write(vbnewline)Response.Write("		document.images.MenuBox.filters.blendTrans.Apply();")Response.Write(vbnewline)Response.Write("	}")Response.Write(vbnewline)Response.Write("	document.images.PictureBox.src = preLoad[jss].src;")Response.Write(vbnewline)Response.Write("	document.images.MenuBox.src = preLoadMenu[jss].src;	")Response.Write(vbnewline)	Response.Write(vbnewline)Response.Write("	if (document.getElementById) document.getElementById(""CaptionBox"").innerHTML= Caption[jss];")Response.Write(vbnewline)Response.Write("	if (document.getElementById) document.getElementById(""TituloBox"").innerHTML= Titulo[jss];")Response.Write(vbnewline)Response.Write("	if (document.all) document.images.PictureBox.filters.blendTrans.Play();")Response.Write(vbnewline)Response.Write("	if (document.all) document.images.MenuBox.filters.blendTrans.Play();")Response.Write(vbnewline)Response.Write(vbnewline)Response.Write("	jss = jss + 1;")Response.Write(vbnewline)Response.Write("	if (jss > (pss)) jss=1;")Response.Write(vbnewline)Response.Write("		tss = setTimeout('runSlideShow()', SlideShowSpeed);")Response.Write(vbnewline)Response.Write("}")Response.Write(vbnewline)Response.Write("</script>")%><link href="estilo/estilo.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style1 {	color: #FFFFFF;	font-weight: bold;}--></style></head><body onload=runSlideShow()><table width="450" height="175" border=0 cellpadding=0 cellspacing=0>  <tr>	<td width=450 valign="top" background="images/destaque.jpg">	  <table width="450" height="158" border="0" cellpadding="2" cellspacing="2">		<tr>		  <td width="202" height="140" align="center" valign="bottom"><div align="center"><img src="destaque/carregando.jpg" name=PictureBox width=185 height=120 border="5" style="border-color:#FFFFFF; "></div></td>		  <td width="234" rowspan="2" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="TextoPadrao">			<tr>				  <td height="13" align=left id=TituloBox style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;">					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;">				</div></td>			</tr>			<tr>				  <td height="40" align=left style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;" id=CaptionBox>					<div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold; height:40px">				</div></td>			</tr>			<tr>			  <td height="57" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;"><%=rs.fields("tipo_noticia")%></div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"><%=left(rs.fields("desc_noticia"),40)%>...</div></td>				</tr>			  </table>			  <%			  if not rs.eof then				  rs.movenext			  end if			  %>			  </td>			</tr>			<tr>			  <td height="52" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">				<tr>				  <td><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF;"><%=rs.fields("tipo_noticia")%></div></td>				</tr>				<tr>				  <td height="30"><div align="left" style="font-family:verdana, arial; font-size:11px; color:#FFFFFF; font-weight:bold;"><%=left(rs.fields("desc_noticia"),40)%>...</div></td>				</tr>			  </table></td>			</tr>		  </table></td>		</tr>		<tr>		  <td valign="top"><div align="center"><img src="destaque/menu.jpg" name=MenuBox width=201 height=22 ></div></td>		</tr>	  </table>	 </td>  </tr>  <tr>  </tr></table>

Compartilhar este post


Link para o post
Compartilhar em outros sites

eis q surge um outro problema

mais creio q nao seja tao dificil de ser resolvido

no campo Caption estao vindos caracteres em branco

vou colar um parte do codigo gerado para você entenderem

 

Caption[1] = "Com mais de 750 mil acessos a seu vídeo ...";Caption[2] = "O combate à gripe aviária, vírus que tem...";Caption[3] = "										...";Caption[4] = "										...";

esta vindo do banco certinho mais com um monte de espaço antes do texto

e como mandei exibir somente 40 caracteres soh ta pegando os espaços

qual a forma de tirar somente os espaços da frente antes de chegar no texto

estou procurando a resposta se eu encontrar ja posto aqui tbm

 

vlw

muito grato pela ajuda

Compartilhar este post


Link para o post
Compartilhar em outros sites

pronto galera ja era consegui fazer funcionar certinhousei um TRIM e prontovlw galera do imasters pela força e pelo espaço t+

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.