Ir para conteúdo

Arquivado

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

zeke_

Sistema de Slide de notícias

Recommended Posts

Bom pessoa, peguei esse script e adaptei para buscar dados na tabela

Script original de: Dirceu Bimont Ivo - http://my.opera.com/bimonti/

 

É tudo relativamente simples: coloquei tudo em apenas uma página para descomplicar

O código está totalmente comentado para identificar as alterações necessárias.

 

CONTEUDO DO BANCO DE DADOS:

id_materia

data_materia

titulo_materia

materia_materia

url_foto_materia

 

<%Dim rsDim rs_numRowsSet rs = Server.CreateObject("ADODB.Recordset")rs.ActiveConnection = MM_noticias_STRINGrs.Source = "SELECT * FROM materias ORDER BY data_materia DESC"rs.CursorType = 0rs.CursorLocation = 2rs.LockType = 1rs.Open()rsNotPainel2_numRows = 0%>%><%Dim strRe__numRowsDim strRe__indexstrRe__numRows = 4strRe__index = 0rs_numRows = rs_numRows + strRe__numRows%><script type="text/javascript">	function settings(){		var el = document.getElementById('settings');		(el.style.display == 'none') ? el.style.display = 'block' : el.style.display = 'none';	}</script><script type="text/javascript">/*$BD:Slide - version 0.9.4$$LastModified: 04/02/2006$Sistema Free para uso pessoal ou comercial contanto que oscréditos permaneçam intactos. Eu já nem estou colocando ummonte de coisa pra não deixar o código pesado. ^^Maiores Informações:[url="http://my.opera.com/bimonti/"]http://my.opera.com/bimonti/[/url]*/slide = {	// vetor com os slides	_imagens : [<%While ((strRe__numRows <> 0) AND (NOT rs.EOF)) Response.Write("["""&(rs("url_foto_materia").Value)&""","""&(rs("data_materia"))&""","""&Mid(rs("titulo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("id_materia"))&""""&"],")Response.Write(vbnewline)strRe__index=strRe__index+1strRe__numRows=strRe__numRows-1rs.MoveNext()Wend%>//COLOQUE UMA IMAGEM QUALQUER AQUI, POIS COMO MOSTRADO ACIMA ELE INSERE O CODIGO AUTOMATICAMENTE,//E NA ULTIMA LINHA (NESSA ABAIXO) NAO PODERA CONTER A VIRGULA DEPOIS DO COLCHETE. ["/IMAGENS/img_rotation_end.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]				],			// ID dos elementos que o sistema modifica	// ID da imagem do slide	_slideImg : 'slideImg',	// ID do link do slide, ou seja, um elemento A	_linkSlide : 'linkSlide',	// ID do título do slide, uma div ou span por exemplo	_titleSlide: 'titleSlide',	// ID do título do slide, idêntico ao de cima	_textSlide : 'textSlide',	// ID da imagem de play|pause	_playPause : 'playpause',	// ID da div que mostra ou esconde as opções de customização de tempo	// essa opção pode ser omitida do usuário, basta retirar o botão	// settings da página, e como a div já vem com o display:none por	// padrão o usuário não terá acesso a essas opções.	_showTimer : 'showTimer',		// variáveis do sistema	// Daqui para baixo não é necessário alterar mais nada, aqui o sistema	// cuidará de tudo	_count : 0,	_length : null,	_timeOutID : null,	_pause : false,	_timer : 4,		// função que inicia o slide e seta todas os parâmetros necessários	start : function(){		with(this){			_preLoader();			_length = _imagens.length;			_work(); 		}	},		// faz o pré-carregamento das imagens	_preLoader : function(){		for(x in this._imagens){			var image = new Image();			image.src = this._imagens[x][1];		}	},		// função principal que faz as checagens necessárias	_work : function(){		with(this){			(_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0);			var current = _imagens[_count];			_exchange(current);			if(!_pause){				(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0);				_timeOutID = setTimeout(						function(){							slide.next();							fade(0,0,$(_slideImg));						}, (Number(_timer)*1000)				);			}		}	},		// função que altera os elementos da página, altere os IDs se necessário	_exchange : function(img){		this.$(this._slideImg).src = img[0];		this.$(this._titleSlide).innerHTML = img[1];		this.$(this._textSlide).innerHTML = img[2];		this.$(this._linkSlide).href = img[3];		this.fade(50,100,this.$(this._slideImg));	},		// altera para o próximo slide ao clicar no botão Próximo	next : function(){		with(this){			_count++;			_work();		}	},		// altera para o slide anterior ao clicar no botão correspondente	previous : function(){		with(this){			_count--;			_work();		}	},		// pausa e continua a apresentação	pause : function(){		var img = this.$(this._playPause);		if(this._pause){			this._pause = false;					img.src = '/modules/noticias/imgs/pause.gif';				img.title = 'Parar';		}		else{			this._pause = true;					img.src = '/modules/noticias/imgs/play.gif';				img.title = 'Continuar';		}		with(this){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _work();}	},		// controla o tempo de troca de cada slide	tControl : function(act){		with(this){		(act=="m")?((_timer==4)?void(0):_timer=_timer-1):((_timer==9)?void(0):_timer= _timer +1);			this.$(this._showTimer).innerHTML = _timer+"s";			}			},		// altera a opacidade do elemento e suaviza a transição entre os slides	fade : function (){				var type,signal;		var from 	= arguments[0];		var to		= arguments[1];		var el		= arguments[2];				(document.all) ? type = 'filter' : type = 'opacity';		(from>to) ? signal = '-' : signal= '+';				if(from >= to/2){			from = eval(from+signal+10);		}else{			from = eval(from+signal+5);		}				if(type=='opacity'){			try{el.style[type] = Number(from*0.01); }catch(e){}		}else{			try{el.style[type] = 'alpha(opacity='+from+')'; }catch(e){}		}				if(from != to){			setTimeout( function(){ slide.fade(from,to,slide.$(slide._slideImg)); } ,50);		}	},		// retorna o elemento solicitado através de seu ID	$ : function(){		return document.getElementById(arguments[0]);		}}</script></head><style type="text/css"><!--img{	border: 0px;}#nav{	width: 100%;	background: #D9ECFF;	padding: 0px;}#nav ul{	padding: 0px;	}#nav ul li{	display: inline;	float: right;	list-style-type: none;	margin: 0px;	padding: 3px;}#nav ul li a{	/*padding: 3px 3px 0px 3px;*/	background: #D9ECFF;}#nav ul li a:hover{	background: #D9ECFF;}#pic{	width: 295px;	padding: 0px;	margin: 0px;}#pic .img{		padding: 3px;	background: #eee;}#titleSlide{padding: 3px;	margin: 0px;	background: #D9ECFF;	}#titleSlide a{	text-decoration: none;	color: #555;}#textSlide{	width: 280px;	padding: 3px;	margin: 0px;	font: normal 12px 'Trebuchet MS';	background: #D9ECFF;	}#settings{	width: 100px;}#settings span, #settings img{	float: left;}#settings span{	font: bold 11px 'Arial';	width: 20px;	text-align: center;	line-height: 19px;	border: 1px dashed #ccc;	background: #eee;	height: 16px;	margin: 0px 2px;}.center{	width: 300px;	float:left;	margin: 0px auto;	background:#D9ECFF;}--></style><body onload="slide.start()">	<table width="300" border="0" cellspacing="0" cellpadding="0">	  <tr>		<td><div class="center">		  <div id="pic"> <a href="" id="linkSlide"> <img name="slideImg" width="294" border="0" height="204" class="img" id="slideImg" /> </a>		  </div>		</div></td>	  </tr>	  <tr>		<td><table width="300" border="0" cellspacing="0" cellpadding="0">		  <tr>			<td width="162" bgcolor="#D9ECFF"><div id="titleSlide" class="faa f10"></div>		   </td>		  <td width="138" align="right" bgcolor="#D9ECFF"> <div id="nav">				<ul>				  <li> <a href="#" onclick="slide.previous();"> <img src="/modules/noticias/imgs/next.gif" /> </a> </li>				  <li> <a href="#" onclick="slide.pause();"> <img id="playpause" src="/modules/noticias/imgs/pause.gif" /> </a> </li>				  <li> <a href="#" onclick="slide.next();"> <img src="/modules/noticias/imgs/past.gif" /> </a> </li>				  </ul>			</div></td>		  </tr>		  <tr>			<td colspan="2" bgcolor="#D9ECFF"> <a href="" id="linkSlide"><div id="textSlide"></div></a></td>		  </tr>		</table></td>	  </tr>	</table>	<%rs.Close()Set rs = Nothing%>

Bom é isso dai, se alguem puder dar mais uma dar mais uma encrementada.

 

Abraços!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boa contribuíção amigo, é sempre bem vindo!!!Quando achar um tempo irei testar!!

<!--#include file="conexoes/conexao_noticias_index.asp" --><%Dim rsDim rs_numRowsSet rs = Server.CreateObject("ADODB.Recordset")rs.ActiveConnection = localbdrs.Source = "SELECT * FROM Noticias ORDER BY codnoticia DESC"rs.CursorType = 0rs.CursorLocation = 2rs.LockType = 1rs.Open()rsNotPainel2_numRows = 0%><%Dim strRe__numRowsDim strRe__indexstrRe__numRows = 4strRe__index = 0rs_numRows = rs_numRows + strRe__numRows%><script type="text/javascript">function settings(){var el = document.getElementById('settings');(el.style.display == 'none') ? el.style.display = 'block' : el.style.display = 'none';}</script><script type="text/javascript">/*$BD:Slide - version 0.9.4$$LastModified: 04/02/2006$Sistema Free para uso pessoal ou comercial contanto que oscréditos permaneçam intactos. Eu já nem estou colocando ummonte de coisa pra não deixar o código pesado. ^^Maiores Informações:[url="http://my.opera.com/bimonti/"]http://my.opera.com/bimonti/[/url]*/slide = {// vetor com os slides_imagens : [<%While ((strRe__numRows <> 0) AND (NOT rs.EOF)) Response.Write("["""&(rs("img").Value)&""","""&(rs("tipo"))&""","""&Mid(rs("titulo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("codnoticia"))&""""&"],")Response.Write(vbnewline)strRe__index=strRe__index+1strRe__numRows=strRe__numRows-1rs.MoveNext()Wend%>//COLOQUE UMA IMAGEM QUALQUER AQUI, POIS COMO MOSTRADO ACIMA ELE INSERE O CODIGO AUTOMATICAMENTE,//E NA ULTIMA LINHA (NESSA ABAIXO) NAO PODERA CONTER A VIRGULA DEPOIS DO COLCHETE. ["../imagens_noticias/mail15.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]	]// ID dos elementos que o sistema modifica// ID da imagem do slide_slideImg : 'slideImg',// ID do link do slide, ou seja, um elemento A_linkSlide : 'linkSlide',// ID do título do slide, uma div ou span por exemplo_titleSlide: 'titleSlide',// ID do título do slide, idêntico ao de cima_textSlide : 'textSlide',// ID da imagem de play|pause_playPause : 'playpause',// ID da div que mostra ou esconde as opções de customização de tempo// essa opção pode ser omitida do usuário, basta retirar o botão// settings da página, e como a div já vem com o display:none por// padrão o usuário não terá acesso a essas opções._showTimer : 'showTimer',// variáveis do sistema// Daqui para baixo não é necessário alterar mais nada, aqui o sistema// cuidará de tudo_count : 0,_length : null,_timeOutID : null,_pause : false,_timer : 4,// função que inicia o slide e seta todas os parâmetros necessáriosstart : function(){with(this){_preLoader();_length = _imagens.length;_work(); }},// faz o pré-carregamento das imagens_preLoader : function(){for(x in this._imagens){var image = new Image();image.src = this._imagens[x][1];}},// função principal que faz as checagens necessárias_work : function(){with(this){(_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0);var current = _imagens[_count];_exchange(current);if(!_pause){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0);_timeOutID = setTimeout(function(){slide.next();fade(0,0,$(_slideImg));}, (Number(_timer)*1000));}}},// função que altera os elementos da página, altere os IDs se necessário_exchange : function(img){this.$(this._slideImg).src = img[0];this.$(this._titleSlide).innerHTML = img[1];this.$(this._textSlide).innerHTML = img[2];this.$(this._linkSlide).href = img[3];this.fade(50,100,this.$(this._slideImg));},// altera para o próximo slide ao clicar no botão Próximonext : function(){with(this){_count++;_work();}},// altera para o slide anterior ao clicar no botão correspondenteprevious : function(){with(this){_count--;_work();}},// pausa e continua a apresentaçãopause : function(){var img = this.$(this._playPause);if(this._pause){this._pause = false;img.src = '/modules/noticias/imgs/pause.gif';img.title = 'Parar';}else{this._pause = true;img.src = '/modules/noticias/imgs/play.gif';img.title = 'Continuar';}with(this){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _work();}},// controla o tempo de troca de cada slidetControl : function(act){with(this){(act=="m")?((_timer==4)?void(0):_timer=_timer-1)(_timer==9)?void(0):_timer= _timer +1);this.$(this._showTimer).innerHTML = _timer+"s";	}},// altera a opacidade do elemento e suaviza a transição entre os slidesfade : function (){var type,signal;var from = arguments[0];var to	= arguments[1];var el	= arguments[2];(document.all) ? type = 'filter' : type = 'opacity';(from>to) ? signal = '-' : signal= '+';if(from >= to/2){from = eval(from+signal+10);}else{from = eval(from+signal+5);}if(type=='opacity'){try{el.style[type] = Number(from*0.01); }catch(e){}}else{try{el.style[type] = 'alpha(opacity='+from+')'; }catch(e){}}if(from != to){setTimeout( function(){ slide.fade(from,to,slide.$(slide._slideImg)); } ,50);}},// retorna o elemento solicitado através de seu ID$ : function(){return document.getElementById(arguments[0]);	}}</script></head><style type="text/css"><!--img{border: 0px;}#nav{width: 100%;background: #D9ECFF;padding: 0px;}#nav ul{padding: 0px;}#nav ul li{display: inline;float: right;list-style-type: none;margin: 0px;padding: 3px;}#nav ul li a{/*padding: 3px 3px 0px 3px;*/background: #D9ECFF;}#nav ul li a:hover{background: #D9ECFF;}#pic{width: 295px;padding: 0px;margin: 0px;}#pic .img{padding: 3px;background: #eee;}#titleSlide{padding: 3px;margin: 0px;background: #D9ECFF;}#titleSlide a{text-decoration: none;color: #555;}#textSlide{width: 280px;padding: 3px;margin: 0px;font: normal 12px 'Trebuchet MS';background: #D9ECFF;}#settings{width: 100px;}#settings span, #settings img{float: left;}#settings span{font: bold 11px 'Arial';width: 20px;text-align: center;line-height: 19px;border: 1px dashed #ccc;background: #eee;height: 16px;margin: 0px 2px;}.center{width: 300px;float:left;margin: 0px auto;background:#D9ECFF;}--></style><body onLoad="slide.start()"><table width="300" border="0" cellspacing="0" cellpadding="0"><tr><td><div class="center"><div id="pic"> <a href="" id="linkSlide"> <img name="slideImg" width="294" border="0" height="204" class="img" id="slideImg" /> </a> </div></div></td></tr><tr><td><table width="300" border="0" cellspacing="0" cellpadding="0"><tr><td width="162" bgcolor="#D9ECFF"><div id="titleSlide" class="faa f10"></div> </td><td width="138" align="right" bgcolor="#D9ECFF"> <div id="nav"><ul><li> <a href="#" onClick="slide.previous();"> <img src="/modules/noticias/imgs/next.gif" /> </a> </li><li> <a href="#" onClick="slide.pause();"> <img id="playpause" src="/modules/noticias/imgs/pause.gif" /> </a> </li><li> <a href="#" onClick="slide.next();"> <img src="/modules/noticias/imgs/past.gif" /> </a> </li></ul></div></td></tr><tr><td colspan="2" bgcolor="#D9ECFF"> <a href="" id="linkSlide"><div id="textSlide"></div></a></td></tr></table></td></tr></table><%rs.Close()Set rs = Nothing%>
eu clico em exibir codigo fonte e ele ta chamando da tabela normal tudo bacana o negocio é q ele naum exibe na tela nada!Olha com,o ficou o meu:

Compartilhar este post


Link para o post
Compartilhar em outros sites

ABAIXO É O QUE NELE ESCREVE EU VISUALIZANDO O CÓDIGO FONTE:

 

 

NOTE QUE ELE TA PUXANDO CORRETAMENTE DADOS DO BD TUDO CERTINHO FIZ ATÉ UMA PEQUENA ADAPTAÇÃO DA STRING DO BANCO DE DADOS E TA RODANDO LEGAL ...

 

MAIS NA HORA DE FAZER OS SLIDES ELE NAUM RODA FICA TRAVADO COMO SE DESSE ERRO DE JAVASCRIPT ACESSA AE ONDE ELE TA HOSPEDADO PRA você VERIFICAR:

 

ACESSA CLICANDO AQUI

 

 

NOTA Q ELE VAI COM-PLETAR E LA EM BAIXO APARECE UM ERRO DE JAVASCRIPT INDICANDO QUE SLIDE NÃO ESTA DFEINIDO ACHO Q É ERRO DE JAVASCRIPT

 

ME AJUDA AE MANO!

 

OLHA O CODE EMBAIXO

 

<script type="text/javascript">function settings(){var el = document.getElementById('settings');(el.style.display == 'none') ? el.style.display = 'block' : el.style.display = 'none';}</script><script type="text/javascript">/*$BD:Slide - version 0.9.4$$LastModified: 04/02/2006$Sistema Free para uso pessoal ou comercial contanto que oscréditos permaneçam intactos. Eu já nem estou colocando ummonte de coisa pra não deixar o código pesado. ^^Maiores Informações:[url="http://my.opera.com/bimonti/"]http://my.opera.com/bimonti/[/url]*/slide = {// vetor com os slides_imagens : [["mail20.jpg","2","É CAMPEÃO!! É CAMPEÃO!!  É CAMPEÃO!!...","/lernoticia.asp?mat=90"]["mail18.jpg","2","1 2 3 4 5 6 TIAGO NELES!...","/lernoticia.asp?mat=89"]["mail17.jpg","2","SUB-20 . A TAÇA É DO NAÇA!...","/lernoticia.asp?mat=86"]["estadio_barras.jpg","1","NORDESTE GANHA DUELO DOS LEÕES...","/lernoticia.asp?mat=85"]["../imagens_noticias/mail15.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]],// ID dos elementos que o sistema modifica// ID da imagem do slide_slideImg : 'slideImg',// ID do link do slide, ou seja, um elemento A_linkSlide : 'linkSlide',// ID do título do slide, uma div ou span por exemplo_titleSlide: 'titleSlide',// ID do título do slide, idêntico ao de cima_textSlide : 'textSlide',// ID da imagem de play|pause_playPause : 'playpause',// ID da div que mostra ou esconde as opções de customização de tempo// essa opção pode ser omitida do usuário, basta retirar o botão// settings da página, e como a div já vem com o display:none por// padrão o usuário não terá acesso a essas opções._showTimer : 'showTimer',// variáveis do sistema// Daqui para baixo não é necessário alterar mais nada, aqui o sistema// cuidará de tudo_count : 0,_length : null,_timeOutID : null,_pause : false,_timer : 4,// função que inicia o slide e seta todas os parâmetros necessáriosstart : function(){with(this){_preLoader();_length = _imagens.length;_work(); }},// faz o pré-carregamento das imagens_preLoader : function(){for(x in this._imagens){var image = new Image();image.src = this._imagens[x][1];}},// função principal que faz as checagens necessárias_work : function(){with(this){(_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0);var current = _imagens[_count];_exchange(current);if(!_pause){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0);_timeOutID = setTimeout(function(){slide.next();fade(0,0,$(_slideImg));}, (Number(_timer)*1000));}}},// função que altera os elementos da página, altere os IDs se necessário_exchange : function(img){this.$(this._slideImg).src = img[0];this.$(this._titleSlide).innerHTML = img[1];this.$(this._textSlide).innerHTML = img[2];this.$(this._linkSlide).href = img[3];this.fade(50,100,this.$(this._slideImg));},// altera para o próximo slide ao clicar no botão Próximonext : function(){with(this){_count++;_work();}},// altera para o slide anterior ao clicar no botão correspondenteprevious : function(){with(this){_count--;_work();}},// pausa e continua a apresentaçãopause : function(){var img = this.$(this._playPause);if(this._pause){this._pause = false;img.src = 'img/pause.gif';img.title = 'Parar';}else{this._pause = true;img.src = 'img/play.gif';img.title = 'Continuar';}with(this){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _work();}},// controla o tempo de troca de cada slidetControl : function(act){with(this){(act=="m")?((_timer==4)?void(0):_timer=_timer-1)(_timer==9)?void(0):_timer= _timer +1);this.$(this._showTimer).innerHTML = _timer+"s";	}},// altera a opacidade do elemento e suaviza a transição entre os slidesfade : function (){var type,signal;var from = arguments[0];var to	= arguments[1];var el	= arguments[2];(document.all) ? type = 'filter' : type = 'opacity';(from>to) ? signal = '-' : signal= '+';if(from >= to/2){from = eval(from+signal+10);}else{from = eval(from+signal+5);}if(type=='opacity'){try{el.style[type] = Number(from*0.01); }catch(e){}}else{try{el.style[type] = 'alpha(opacity='+from+')'; }catch(e){}}if(from != to){setTimeout( function(){ slide.fade(from,to,slide.$(slide._slideImg)); } ,50);}},// retorna o elemento solicitado através de seu ID$ : function(){return document.getElementById(arguments[0]);	}}</script></head><style type="text/css"><!--img{border: 0px;}#nav{width: 100%;background: #D9ECFF;padding: 0px;}#nav ul{padding: 0px;}#nav ul li{display: inline;float: right;list-style-type: none;margin: 0px;padding: 3px;}#nav ul li a{/*padding: 3px 3px 0px 3px;*/background: #D9ECFF;}#nav ul li a:hover{background: #D9ECFF;}#pic{width: 295px;padding: 0px;margin: 0px;}#pic .img{padding: 3px;background: #eee;}#titleSlide{padding: 3px;margin: 0px;background: #D9ECFF;}#titleSlide a{text-decoration: none;color: #555;}#textSlide{width: 280px;padding: 3px;margin: 0px;font: normal 12px 'Trebuchet MS';background: #D9ECFF;}#settings{width: 100px;}#settings span, #settings img{float: left;}#settings span{font: bold 11px 'Arial';width: 20px;text-align: center;line-height: 19px;border: 1px dashed #ccc;background: #eee;height: 16px;margin: 0px 2px;}.center{width: 300px;float:left;margin: 0px auto;background:#D9ECFF;}--></style><body onLoad="slide.start()"><table width="300" border="0" cellspacing="0" cellpadding="0"><tr><td><div class="center"><div id="pic"> <a href="" id="linkSlide"> <img name="slideImg" width="294" border="0" height="204" class="img" id="slideImg" /> </a> </div></div></td></tr><tr><td><table width="300" border="0" cellspacing="0" cellpadding="0"><tr><td width="162" bgcolor="#D9ECFF"><div id="titleSlide" class="faa f10"></div> </td><td width="138" align="right" bgcolor="#D9ECFF"> <div id="nav"><ul><li> <a href="#" onClick="slide.previous();"> <img src="img/next.gif" /> </a> </li><li> <a href="#" onClick="slide.pause();"> <img id="playpause" src="img/pause.gif" /> </a> </li><li> <a href="#" onClick="slide.next();"> <img src="img/past.gif" /> </a> </li></ul></div></td></tr><tr><td colspan="2" bgcolor="#D9ECFF"> <a href="" id="linkSlide"><div id="textSlide"></div></a></td></tr></table></td></tr></table>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Júnior,

Altere esse linha do seu javascript

(act=="m")?((_timer==4)?void(0):_timer=_timer-1)(_timer==9)?void(0):_timer= _timer +1);

POR

(act=="m")?((_timer==4)?void(0):_timer=_timer-1):((_timer==9)?void(0):_timer= _timer +1);

 

O que aconteceu foi que na hora que postei o código aqui, ele transformou :( em emoticon

 

Agora pode testar que vai dar certo.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Mano eu alterei e continua o mesmo erro confere ae:

 

http://www.nacionalfutebolclube.com.br/200...howNacional.asp

 

continua erro la em baixo na barra de status do iexplorre ele mostra um erro de java script q diz: slide não está definido

 

me ajuda novamente ae mano por favor!

 

Júnior,

Altere esse linha do seu javascript

(act=="m")?((_timer==4)?void(0):_timer=_timer-1)(_timer==9)?void(0):_timer= _timer +1);

POR

(act=="m")?((_timer==4)?void(0):_timer=_timer-1):((_timer==9)?void(0):_timer= _timer +1);

 

O que aconteceu foi que na hora que postei o código aqui, ele transformou :( em emoticon

 

Agora pode testar que vai dar certo.

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Desculpa a demora ai...

 

Junior, encontrei outro erro, não sei pq o seu script está sem a virgula nessa linha do código, sendo que no original que postei está com ela.

 

logo após de você definir as imagens e os textos que irão para o slide no fechamento do item "_imagens" falou a vírgula depois do colchete.

 

veja a parte do seu código que tirei do site:

// vetor com os slides

_imagens : [

 

["mail35.jpg","2","E VAI COMEÇAR O JUVENIL!...","/lernoticia.asp?mat=100"],

["mail33.jpg","2","RONDINELLI E TIAGO CONVOCADOS...","/lernoticia.asp?mat=99"],

["mail32.jpg","2","RIONAL NO FUTSAL...","/lernoticia.asp?mat=98"],

["mail31.jpg","2","COMEÇAMOS O 2º TURNO COMO TERMINAMOS O 1º TUR...","/lernoticia.asp?mat=97"],

 

["../imagens_noticias/mail15.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]

]

 

====================================================================

 

agora você tem que colocar a virgula depois doultimo conchete assim:

// vetor com os slides

_imagens : [

 

["mail35.jpg","2","E VAI COMEÇAR O JUVENIL!...","/lernoticia.asp?mat=100"],

["mail33.jpg","2","RONDINELLI E TIAGO CONVOCADOS...","/lernoticia.asp?mat=99"],

["mail32.jpg","2","RIONAL NO FUTSAL...","/lernoticia.asp?mat=98"],

["mail31.jpg","2","COMEÇAMOS O 2º TURNO COMO TERMINAMOS O 1º TUR...","/lernoticia.asp?mat=97"],

 

["../imagens_noticias/mail15.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]

],

 

Espero que agora de certo.

 

Mas qualquer coisa, estou por aqui.

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

COLABORAÇÃO SISTEMA SLIDE + ASP RODANDO 100% ABAIXO O CÓDIGO COMPLETO PARA QUEM QUISER UTILIZAR!

 

ABRAÇO!

 

 

 

ASP
<!--#include file="conexoes/conexao_noticias_index.asp" -->
<%
Dim rs
Dim rs_numRows
 
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = localbd
rs.Source = "SELECT * FROM Noticias ORDER BY codnoticia DESC"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
 
rsNotPainel2_numRows = 0
%>
<%
Dim strRe__numRows
Dim strRe__index
 
strRe__numRows = 4
strRe__index = 0
rs_numRows = rs_numRows + strRe__numRows
%>
 
<script type="text/javascript">
function settings(){
var el = document.getElementById('settings');
(el.style.display == 'none') ? el.style.display = 'block' : el.style.display = 'none';
}
</script>
<script type="text/javascript">
/*
$BD:Slide - version 0.9.4$
$LastModified: 04/02/2006$
 
Sistema Free para uso pessoal ou comercial contanto que os
créditos permaneçam intactos. Eu já nem estou colocando um
monte de coisa pra não deixar o código pesado. ^^
 
Maiores Informações:
 
Colaboração Code SLIDE VERSÃO ASP :
 
Júnior Dias: Tecnologiasvirtuais@gmail.com
Zeke_ : Fórum Imasters
*/
 
slide = {
 
// vetor com os slides
_imagens : [
 
<%
While ((strRe__numRows <> 0) AND (NOT rs.EOF))
Response.Write("[""../imagens_noticias/"&(rs("img").Value)&""","""&(rs("tipo"))&""","""&Mid(rs("titulo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("codnoticia"))&""""&"],")
Response.Write(vbnewline)
strRe__index=strRe__index+1
strRe__numRows=strRe__numRows-1
rs.MoveNext()
Wend
%>
["../imagens_noticias/mail15.jpg","ANUNCIE AQUI","Aqui sua empresa APARECE","ANUNCIE.htm"]//qulquier
],
// ID dos elementos que o sistema modifica
// ID da imagem do slide
_slideImg : 'slideImg',
// ID do link do slide, ou seja, um elemento A
_linkSlide : 'linkSlide',
// ID do título do slide, uma div ou span por exemplo
_titleSlide: 'titleSlide',
// ID do título do slide, idêntico ao de cima
_textSlide : 'textSlide',
// ID da imagem de play|pause
_playPause : 'playpause',
// ID da div que mostra ou esconde as opções de customização de tempo
// essa opção pode ser omitida do usuário, basta retirar o botão
// settings da página, e como a div já vem com o display:none por
// padrão o usuário não terá acesso a essas opções.
_showTimer : 'showTimer',
 
 
// variáveis do sistema
// Daqui para baixo não é necessário alterar mais nada, aqui o sistema
// cuidará de tudo
_count : 0,
_length : null,
_timeOutID : null,
_pause : false,
_timer : 4,
 
// função que inicia o slide e seta todas os parâmetros necessários
start : function(){
with(this){
_preLoader();
_length = _imagens.length;
_work();
}
},
 
// faz o pré-carregamento das imagens
_preLoader : function(){
for(x in this._imagens){
var image = new Image();
image.src = this._imagens[x][1];
}
},
 
// função principal que faz as checagens necessárias
_work : function(){
with(this){
(_count == _length) ? _count = 0 : (_count < 0) ? _count = _length-1 : void(0);
var current = _imagens[_count];
_exchange(current);
if(!_pause){
(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0);
_timeOutID = setTimeout(
function(){
slide.next();
fade(0,0,$(_slideImg));
}, (Number(_timer)*1000)
);
}
}
},
 
// função que altera os elementos da página, altere os IDs se necessário
_exchange : function(img){
this.$(this._slideImg).src = img[0];
this.$(this._titleSlide).innerHTML = img[1];
this.$(this._textSlide).innerHTML = img[2];
this.$(this._linkSlide).href = img[3];
this.fade(50,100,this.$(this._slideImg));
},
 
// altera para o próximo slide ao clicar no botão Próximo
next : function(){
with(this){
_count++;
_work();
}
},
 
// altera para o slide anterior ao clicar no botão correspondente
previous : function(){
with(this){
_count--;
_work();
}
},
 
// pausa e continua a apresentação
pause : function(){
var img = this.$(this._playPause);
if(this._pause){
this._pause = false;
img.src = 'img/pause.gif';
img.title = 'Parar';
}
else{
this._pause = true;
img.src = 'img/play.gif';
img.title = 'Continuar';
}
with(this){(typeof(_timeOutID) == "number") ? clearTimeout(_timeOutID) : void(0); _work();}
},
 
// controla o tempo de troca de cada slide
tControl : function(act){
with(this){
(act=="m")?((_timer==4)?void(0):_timer=_timer-1):((_timer==9)?void(0):_timer= _timer +1);
 
this.$(this._showTimer).innerHTML = _timer+"s"
}
 
},
 
// altera a opacidade do elemento e suaviza a transição entre os slides
fade : function (){
 
var type,signal;
var from = arguments[0];
var to  = arguments[1];
var el  = arguments[2];
 
(document.all) ? type = 'filter' : type = 'opacity';
(from>to) ? signal = '-' : signal= '+';
 
if(from >= to/2){
from = eval(from+signal+10);
}else{
from = eval(from+signal+5);
}
 
if(type=='opacity'){
try{el.style[type] = Number(from*0.01); }catch(e){}
}else{
try{el.style[type] = 'alpha(opacity='+from+')'; }catch(e){}
}
 
if(from != to){
setTimeout( function(){ slide.fade(from,to,slide.$(slide._slideImg)); } ,50);
}
},
 
// retorna o elemento solicitado através de seu ID
$ : function(){
return document.getElementById(arguments[0]);   
}
}
</script>
 
</head>
<style type="text/css">
<!--
img{
border: 0px;
}
#nav{
width: 100%;
background: #D9ECFF;
padding: 0px;
}
#nav ul{
padding: 0px;
 
}
#nav ul li{
display: inline;
float: right;
list-style-type: none;
 
margin: 0px;
padding: 3px;
}
#nav ul li a{
/*padding: 3px 3px 0px 3px;*/
background: #D9ECFF;
}
#nav ul li a:hover{
background: #D9ECFF;
}
#pic{
width: 295px;
padding: 0px;
margin: 0px;
}
#pic .img{
 
padding: 3px;
background: #eee;
}
#titleSlide{
padding: 3px;
margin: 0px;
background: #D9ECFF;
 
}
#titleSlide a{
text-decoration: none;
color: #555;
}
 
#textSlide{
width: 280px;
padding: 3px;
margin: 0px;
font: normal 12px 'Trebuchet MS';
background: #D9ECFF;
 
}
#settings{
width: 100px;
}
#settings span, #settings img{
float: left;
}
#settings span{
font: bold 11px 'Arial';
width: 20px;
text-align: center;
line-height: 19px;
border: 1px dashed #ccc;
background: #eee;
height: 16px;
margin: 0px 2px;
}
 
.center{
width: 300px;
float:left;
margin: 0px auto;
background:#D9ECFF;
}
-->
</style>
 
<body onLoad="slide.start()">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div class="center">
<div id="pic"> <a href="" id="linkSlide"> <img name="slideImg" width="294" border="0" height="204" class="img" id="slideImg" /> </a> </div>
</div></td>
</tr>
<tr>
<td><table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="162" bgcolor="#D9ECFF"><div id="titleSlide" class="faa f10"></div> </td>
<td width="138" align="right" bgcolor="#D9ECFF"> <div id="nav">
<ul>
<li> <a href="#" onClick="slide.previous();"> <img src="img/next.gif" /> </a> </li>
<li> <a href="#" onClick="slide.pause();"> <img id="playpause" src="img/pause.gif" /> </a> </li>
<li> <a href="#" onClick="slide.next();"> <img src="img/past.gif" /> </a> </li>
</ul>
</div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECFF"> <a href="" id="linkSlide"><div id="textSlide"></div></a></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.Close()
Set rs = Nothing
%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá Júnior Dias

Seu código ficou muito bom, parabéns!!!

Fiz algumas alterações para testar, pois no código acima dependendo do tamanho do texto apresentado, a caixa aumenta e depois quando volta uma com texto menor ela diminui. Ou seja, se o tópico de determinada notícia tem 3 linhas, outra duas e outra uma, cada caixa fica de uma tamanho, alterando assim o layout do site.

Ah, me desculpe a indiscrição, acho que se você postasse o código da sua conexão ficaria bem mais completo, pois para leigos, que não identificarem o que foi declarado na conexão, o código é semelhante a ponte do Senado, que liga nada a lugar nehum.

Tirando isso, parabéns, ficou muito bom mesmo.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aê Junior,

Cara o slideshow ficou batuta.... Muito bom mesmo, testei algumas alterações aqui e ficou show de bola.

Vou deixar uma alteraçãozinha aqui no estilo, digamos style, eu usei como include, mas da forma como estava não conseguia alterar a forma e tamanho das letras.

Fiz a Alteração abaixo:

ASP
<style type="text/css">

<!--

img{

border: 0px;

}

#nav{

width: 100%;

background: #FFFFFFC;

padding: 0px;

}

#nav ul{

padding: 0px;

}

#nav ul li{

display: inline;

float: right;

list-style-type: none;

margin: 0px;

padding: 1px;

}

#nav ul li a{

/*padding: 0px 0px 0px 0px;*/

background: #FFFFFF;

}

#nav ul li a:hover{

background: #FFFFFF;

}

#pic{

width: 250px;

padding: 0px;

margin: 0px;

}

#pic .img{

padding: 0px;

background: #eee;

}

#titleSlide{

padding: 0px;

margin: 0px;

background: #FFFFFF;

text-align: center;

font-family: Arial;

font-size: 14px;

font-weight: bold;

valign: middle

}

#titleSlide a{

text-align: center;

font-size: 0pt;

text-decoration: bold;

}

#textSlide{

width: 245px;

padding: 0px;

margin: 0px;

background: #FFFFFF;

text-align: justify;

font-family: Tahoma;

font-size: 15px;

font-weight: bold;

valign: middle

}

#settings{

width: 100px;

}

#settings span, #settings img{

float: left;

}

#settings span{

font-size: bold 0px 'Arial';

width: 0px;

text-align: center;

font-color: red;

line-height: 0px;

border: 1px dashed #ccc;

background: #eee;

height: 0px;

margin: 0px 0px;

}

.center{

width: 250px;

float:left;

margin: 0px auto;

background:#FFFFFF;

}

-->

</style>

Testem das duas formas

Grande abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Grande Silva tudo k? ehe legal é poder compartilhar conhecimentos com todos!

 

abraço!

 

 

Aê Junior,

Cara o slideshow ficou batuta.... Muito bom mesmo, testei algumas alterações aqui e ficou show de bola.

Vou deixar uma alteraçãozinha aqui no estilo, digamos style, eu usei como include, mas da forma como estava não conseguia alterar a forma e tamanho das letras.

Fiz a Alteração abaixo:

ASP
<style type="text/css">

<!--

img{

border: 0px;

}

#nav{

width: 100%;

background: #FFFFFFC;

padding: 0px;

}

#nav ul{

padding: 0px;

}

#nav ul li{

display: inline;

float: right;

list-style-type: none;

margin: 0px;

padding: 1px;

}

#nav ul li a{

/*padding: 0px 0px 0px 0px;*/

background: #FFFFFF;

}

#nav ul li a:hover{

background: #FFFFFF;

}

#pic{

width: 250px;

padding: 0px;

margin: 0px;

}

#pic .img{

padding: 0px;

background: #eee;

}

#titleSlide{

padding: 0px;

margin: 0px;

background: #FFFFFF;

text-align: center;

font-family: Arial;

font-size: 14px;

font-weight: bold;

valign: middle

}

#titleSlide a{

text-align: center;

font-size: 0pt;

text-decoration: bold;

}

#textSlide{

width: 245px;

padding: 0px;

margin: 0px;

background: #FFFFFF;

text-align: justify;

font-family: Tahoma;

font-size: 15px;

font-weight: bold;

valign: middle

}

#settings{

width: 100px;

}

#settings span, #settings img{

float: left;

}

#settings span{

font-size: bold 0px 'Arial';

width: 0px;

text-align: center;

font-color: red;

line-height: 0px;

border: 1px dashed #ccc;

background: #eee;

height: 0px;

margin: 0px 0px;

}

.center{

width: 250px;

float:left;

margin: 0px auto;

background:#FFFFFF;

}

-->

</style>

Testem das duas formas

Grande abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boa a atitude dos dois, a contribuição está perfeita...

 

Testarei o código e assim que puder colocarei o resultado da minha análise pessoal!

 

Diante mão, parabéns!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tem, é só alterar a parte que "escreve" o texto abaixo da foto para adicionar a TAG HTML de link.

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.