Ir para conteúdo

POWERED BY:

Arquivado

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

Thiago K.

Repete linhas

Recommended Posts

Olá,

 

Estou usando o jcarrousel com thickbox, alimentado via banco de dados. O que acontece é que preciso tirar o "," do último item exibido na listagem.

 

{url: "images/galeria/1.jpg", title: "foto 1"},	
	{url: "images/galeria/2.jpg", title: "foto 2"},	
	{url: "images/galeria/3.jpg", title: "foto 3"},	
	{url: "images/galeria/4.jpg", title: "foto 4"},	
	{url: "images/galeria/5.jpg", title: "foto 5"},
	{url: "images/galeria/6.jpg", title: "foto 6"},	
	{url: "images/galeria/7.jpg", title: "foto 7"},	
	{url: "images/galeria/8.jpg", title: "foto 8"},

O código para repetir as linhas está assim:

 

<%While NOT rsGaleria.EOF%>
	{url: "<%=rsGaleria(2)%>", title: "<%=rsGaleria(3)%>"},
	<%
rsGaleria.MoveNext()
Wend
%>

O que devo fazer para ele entender que está na última linha e tirar essa vírgula?

 

Agradeço desde já.

Compartilhar este post


Link para o post
Compartilhar em outros sites

pega a ultima linha e dá um Replace(), nele, trocando a virgula por ""

Compartilhar este post


Link para o post
Compartilhar em outros sites

é apenas no ultimo registro, ou todos tem ????

você pode fazer um loop para retirar , ou até mesmo jogar em um array

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tenho que tirar a vírgula apenas do ultimo registro, para o script não dar erro.

 

Do jeito que estou fazendo ele fica assim:

 

var mycarousel_itemList = [

{url: "images/galeria/1.jpg", title: "foto 1"},

{url: "images/galeria/2.jpg", title: "foto 2"},

{url: "images/galeria/3.jpg", title: "foto 3"},

{url: "images/galeria/4.jpg", title: "foto 4"},

{url: "images/galeria/5.jpg", title: "foto 5"},

{url: "images/galeria/6.jpg", title: "foto 6"},

{url: "images/galeria/7.jpg", title: "foto 7"},

{url: "images/galeria/8.jpg", title: "foto 8"},

];

 

E o certo deveria ser assim, sem a vírgula no final do arquivo:

 

var mycarousel_itemList = [

{url: "images/galeria/1.jpg", title: "foto 1"},

{url: "images/galeria/2.jpg", title: "foto 2"},

{url: "images/galeria/3.jpg", title: "foto 3"},

{url: "images/galeria/4.jpg", title: "foto 4"},

{url: "images/galeria/5.jpg", title: "foto 5"},

{url: "images/galeria/6.jpg", title: "foto 6"},

{url: "images/galeria/7.jpg", title: "foto 7"},

{url: "images/galeria/8.jpg", title: "foto 8"}

];

 

Obrigado!

Compartilhar este post


Link para o post
Compartilhar em outros sites

ótimo k conseguiu, e nao eskça k tb existem funçoes no forum para recuperar o ultimo regsitro...

até a próxima...

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.