Ir para conteúdo

POWERED BY:

Arquivado

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

Reinaldo

slide show

Recommended Posts

Por favor copiei o codigo disponivel aqi no forum mas não estou conseguindo colocar para funcionar;

veja: http://www.factae.edu.br/meu_slideshow.asp

 

Segue o codigo, estou usando o Mysql. Não sei onde arrumar isso.

 

<%
Dim rs
Dim rs_numRows

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = conexao
rs.Source = "SELECT* FROM tab_noticias ORDER BY ID_Noticias 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:
[url="http://my.opera.com/bimonti/"]http://my.opera.com/bimonti/[/url]

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("[""/imagem/noticias/"&(rs("img").Value)&""","""&(rs("titulo"))&""","""&Mid(rs("conteudo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("ID_Noticias"))&""""&"],")
	Response.Write(vbnewline)
	strRe__index=strRe__index+1
	strRe__numRows=strRe__numRows-1
	rs.MoveNext()
Wend
%>

["/imagem/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 = 'imgs/pause.gif';
	img.title = 'Parar';
}

else{
this._pause = true;
img.src = '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="imgs/next.gif" width="16" height="16" /> </a> </li>
<li> <a href="#" onClick="slide.pause();"> <img src="imgs/pause.gif" width="16" height="16" id="playpause" /> </a> </li>
<li> <a href="#" onClick="slide.next();"> <img src="imgs/past.gif" width="16" height="16" /> </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

vamos lá, em primeira mão, você disse que não está conseguindo, isso é código do DW, horrível hehe!

 

Gera algum erro de início? Se gerar, posta ele ai!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá Amigo,

Infelizemnte não aparece erro algum só a pagina em branco, esse codigo está aki no forum em algum lugar.

Não faço ideia do que possa ser.

 

vamos lá, em primeira mão, você disse que não está conseguindo, isso é código do DW, horrível hehe!

 

Gera algum erro de início? Se gerar, posta ele ai!

Compartilhar este post


Link para o post
Compartilhar em outros sites

reparei que no link que você passou no post, se você ver o codigo fonte dele, nessa parte:

 

["imagem/noticias/","Matrí­cula FACTAE (Processo Seletivo 2009.1/1)","<P>Prezados candidatos aprovados em nosso Pro...","/lernoticia.asp?mat=14"],
["imagem/noticias/","CIÊNCIAS CONTÁBEIS É UMA BOA OPÇÃO PARA QUEM QUER O SUCESSO PROFISSIONAL","<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt...","/lernoticia.asp?mat=19"],
["imagem/noticias/SDC10079.jpg","Capacitação de Gestores e Lí­deres","<P>A FACTAE acreditando e investindo em seus ...","/lernoticia.asp?mat=23"],
["imagem/noticias/","Boas Vindas!","<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt...","/lernoticia.asp?mat=25"],

está formatado errado seu javascript!!

ou a geração dele, o problema são as aspas duplas, veja corretamente ai!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Meu caro seria essa linha aki o problema?

 

Response.Write("[""imagem/noticias/"&(rs("img").Value)&""","""&(rs("titulo"))&""","""&Mid(rs("conteudo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("ID_Noticias"))&""""&"],")

reparei que no link que você passou no post, se você ver o codigo fonte dele, nessa parte:

 

["imagem/noticias/","Matrí­cula FACTAE (Processo Seletivo 2009.1/1)","<P>Prezados candidatos aprovados em nosso Pro...","/lernoticia.asp?mat=14"],
["imagem/noticias/","CIÊNCIAS CONTÁBEIS É UMA BOA OPÇÃO PARA QUEM QUER O SUCESSO PROFISSIONAL","<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt...","/lernoticia.asp?mat=19"],
["imagem/noticias/SDC10079.jpg","Capacitação de Gestores e Lí­deres","<P>A FACTAE acreditando e investindo em seus ...","/lernoticia.asp?mat=23"],
["imagem/noticias/","Boas Vindas!","<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt...","/lernoticia.asp?mat=25"],

está formatado errado seu javascript!!

ou a geração dele, o problema são as aspas duplas, veja corretamente ai!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Esse é seu código inteiro?

 

Se tiver como disponibilizar uma URL da página com o erro seria melhor. Pois aí tem Javascript, ASP, etc, o erro pode ser qualquer coisa.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pois é amigo, mas não tem erro sendo mostrado apenas a pagina dessa forma:

http://www.factae.edu.br/meu_slideshow.asp

valeu!!

Aqui vai o codigo inteiro:

 

<%
Dim rs
Dim rs_numRows

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = conexao
rs.Source = "SELECT* FROM tab_noticias ORDER BY ID_Noticias 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:
[url="http://my.opera.com/bimonti/"]http://my.opera.com/bimonti/[/url]

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("[""/imagem/noticias/"&(rs("img").Value)&""","""&(rs("titulo"))&""","""&Mid(rs("conteudo"),1,45)&"..."",""/lernoticia.asp?mat="&(rs("ID_Noticias"))&""""&"],")
	Response.Write(vbnewline)
	strRe__index=strRe__index+1
	strRe__numRows=strRe__numRows-1
	rs.MoveNext()
Wend
%>

["/imagem/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 = 'imgs/pause.gif';
	img.title = 'Parar';
}

else{
this._pause = true;
img.src = '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="imgs/next.gif" width="16" height="16" /> </a> </li>
<li> <a href="#" onClick="slide.pause();"> <img src="imgs/pause.gif" width="16" height="16" id="playpause" /> </a> </li>
<li> <a href="#" onClick="slide.next();"> <img src="imgs/past.gif" width="16" height="16" /> </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
%>

Esse é seu código inteiro?

 

Se tiver como disponibilizar uma URL da página com o erro seria melhor. Pois aí tem Javascript, ASP, etc, o erro pode ser qualquer coisa.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Mensagens de erro:

Erro: missing ] after element list

Arquivo-fonte: http://www.factae.edu.br/meu_slideshow.asp

Linha: 83, Coluna: 122

Código-fonte:

[imagem/noticias/"","CIÊNCIAS CONTÁBEIS É UMA BOA OPÇÃO PARA QUEM QUER O SUCESSO PROFISSIONAL","<P class=MsoNormal style=MARGIN: 0cm 0cm 0pt...","/lernoticia.asp?mat=19],

Erro: slide is not defined

Arquivo-fonte: http://www.factae.edu.br/meu_slideshow.asp

Linha: 1

De inicio, remova as tags de rs("conteudo"), se necessário utilize a função 3 pontinhos que o jonathandj postou no Laboratório de Scripts. E substitua aspas por aspas simples, também de dentro de conteúdo.

Compartilhar este post


Link para o post
Compartilhar em outros sites

dá uma olhada neste exemplo:

 

aqui

 

talves possa te ajudar

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.