Ir para conteúdo

POWERED BY:

Arquivado

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

Aline Meira

Aplicar lightbox em fotos de banco de dados mysql

Recommended Posts

olá pessoal! eu tenho um arquivo que mostra fotos de um banco de dados. preciso aplicar o lightbox nas fotos em miniatura mas não estou conseguindo. eu consigo aplicá-lo em uma galeria sem banco de dados, mas com bd não consigo. o código é o seguinte:

 

 

 

 

 

<table width="78%" border="0" align="center" cellpadding="0" cellspacing="6" valign="top">
<?//////////////////////////////////////////////////////////////////?>
<? //$link=mysql_connect("localhost", "root" ,"");
//mysql_select_db("james", $link);
$sql=("select * from fotos where (imovel='$cod_imovel') ORDER BY Id");
$resultado=mysql_query($sql) or die (mysql_error());
$indica_linha=0;
echo "<tr>";
if (mysql_num_rows($resultado) == 0){
echo "<br>\n";
echo "<td valign='top'><div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Este imóvel não possui fotos !!!</font></div></td>\n";
}else{
?>
<b>
<div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Clique nas fotos para ampliar</font></div></b>
<?
}
for ($x=1; $x<=(mysql_num_rows($resultado)); $x++)
{
$mostra_resultado=mysql_fetch_object($resultado);
$rest = substr($mostra_resultado->link, 33, strlen($mostra_resultado->link));
if (file_exists($rest)){
$indica_linha++;
if($indica_linha > 4)
{
print ("</TR><TR>");
$indica_linha=1;
}
$tipo_="";
$tipo1_="";
$teste = explode("/",$mostra_resultado->link);
$teste2=sizeof($teste);
$teste3=explode(" ",$teste[$teste2-1]);
$teste4=sizeof($teste3);
for ($i=0;$i<($teste2-1);$i++) {
$tipo_ = $tipo_.$teste[$i]."/";
}
for ($i=0;$i<($teste4);$i++) {
if ($i==$teste4-1){
$tipo1_ = $tipo1_.$teste3[$i];
}else{
$tipo1_ = $tipo1_.$teste3[$i]."%20";
}
}
$tipo1_= $tipo_.$tipo1_;
$tipo_= $tipo_.rawurlencode($teste[$teste2-1]);
?>
<td width="25%"><div align="center"><a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"><img src="<?=$tipo_;?>" width="50" height="40" border="0" alt='Clique para ampliar'></a> </div></td>
<?
}
}
?>
<?//////////////////////////////////////////////////////////////////?>
</tr>
</table>
o texto em vermelho é onde as fotos abrem atualmente, que é sem lightbox, e o texto em verde é onde aparece as miniaturas das fotos. o que eu preciso é abrir essas miniaturas com lightbox. alguém pode me ajudar? por favor :blush:

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Mostre sua função lightbox jquery para que possamos avaliar melhor.

 

 

aqui está todo o código:

 

 

 

 

<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Informações do Imóvel</title>
<script src="js/jquery-1.7.2.min.js" />
<script src="js/lightbox.js" />
<link href="css/lightbox.css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.auto-style1 {
border-width: 0;
}
</style>
</head>
<script>
<!--
function janela1(str,w,h)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
win = window.open(str, 'tipWin1', winprops)
}
-->
</script>
<script>
<!--
function janela3(str,w,h)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
win = window.open(str, 'tipWin1', winprops)
}
-->
</script>
<body>
<br>
<br>
<div align="center">
<table width="733" border="0" cellpadding="0" cellspacing="0" bordercolor="#D1D1D1" class="auto-style1">
<tr>
<td bgcolor="#D2E28B" style="height: 19px">
<div align="center"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Imóvel: <b>
<?
$cod_imovel=$imovel;
echo $cod_imovel;
include('data.php');
$resultado=mysql_query("select * from imoveis where imovel='$cod_imovel'");
$mostra_resultado=mysql_fetch_object($resultado);
?>
</b></font></div></div></td>
<td width="258" bgcolor="#D2E28B" style="height: 19px">
<div align="center"></div></td>
</tr>
<tr>
<td width="475" height="162"><table width="98%" height="145" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="11" height="141"><div align="right"> </div></td>
<td width="225"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><? print $mostra_resultado->descr; ?></font></strong></td>
<td width="12"><p> </p>
<p> </p></td>
<td width="208" height="100%"><p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Tabela de preços
(valor por dia):</font></p>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <? print $mostra_resultado->vlrper; ?></font></p>
<p><font size="1" face="Verdana">obs: será cobrada a parte uma taxa
única de limpeza para o período locado (valor sob consulta).</font></p>
<p><a href="javascript:janela3('google.php?g1=<?=$mostra_resultado->g1;?>&g2=<?=$mostra_resultado->g2;?>&imovel=<?=$cod_imovel?>','640','480')">
<img src="imagens/maps.jpg" width="150" height="20" border="0"></a></p></td>
</tr>
</table></td>
<td height="162" >
<table width="78%" border="0" align="center" cellpadding="0" cellspacing="6" valign="top">
<?//////////////////////////////////////////////////////////////////?>
<? //$link=mysql_connect("localhost", "root" ,"");
//mysql_select_db("james", $link);
$sql=("select * from fotos where (imovel='$cod_imovel') ORDER BY Id");
$resultado=mysql_query($sql) or die (mysql_error());
$indica_linha=0;
echo "<tr>";
if (mysql_num_rows($resultado) == 0){
echo "<br>\n";
echo "<td valign='top'><div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Este imóvel não possui fotos !!!</font></div></td>\n";
}else{
?>
<b>
<div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Clique nas fotos para ampliar</font></div></b>
<?
}
for ($x=1; $x<=(mysql_num_rows($resultado)); $x++)
{
$mostra_resultado=mysql_fetch_object($resultado);
$rest = substr($mostra_resultado->link, 33, strlen($mostra_resultado->link));
if (file_exists($rest)){
$indica_linha++;
if($indica_linha > 4)
{
print ("</TR><TR>");
$indica_linha=1;
}
$tipo_="";
$tipo1_="";
$teste = explode("/",$mostra_resultado->link);
$teste2=sizeof($teste);
$teste3=explode(" ",$teste[$teste2-1]);
$teste4=sizeof($teste3);
for ($i=0;$i<($teste2-1);$i++) {
$tipo_ = $tipo_.$teste[$i]."/";
}
for ($i=0;$i<($teste4);$i++) {
if ($i==$teste4-1){
$tipo1_ = $tipo1_.$teste3[$i];
}else{
$tipo1_ = $tipo1_.$teste3[$i]."%20";
}
}
$tipo1_= $tipo_.$tipo1_;
$tipo_= $tipo_.rawurlencode($teste[$teste2-1]);
?>
<td width="25%"><div align="center"><a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"><img src="<?=$tipo_;?>" rel="lightbox" width="50" height="40" border="0" alt='Clique para ampliar'></a></div></td>
<?
}
}
?>
<?//////////////////////////////////////////////////////////////////?>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D2E28B">
<div align="center"> </div></td>
</tr>
<tr>
<td colspan="2">
<?
;
include("cal.php");
?>
<table width="100%" border="0" cellspacing="2" align="left" height="34">
<tr>
<td width="84%"><div align="center"> </div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#D2E28B">
<p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="javascript:janela3('contato-reserve.php?imovel=<?=$cod_imovel?>','1039','810')"><strong>
<font color="#000000">Clique aqui para mais informações</font></strong></a></font></td>
</tr>
</table>
</div>
</html>
em vermelho está as coisas que eu inseri do lightbox, mas mesmo assim não funciona.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom, está faltando o principal: Você utilizar o lightbox, pois você só incluiu a biblioteca na sua página.

 

Vamos lá :

 

1 - Você pode utiliza a seguinte função lightbox dentro da uma tag script:

 

 

 

<script type="text/javascript">
$(function() {
	$('a.lightbox').lightBox(); // Seleciona todos os links com a classe lightbox	
});
</script>


 

 

2 - Mude a parte do código onde tem a sua imagem em miniatura para

 

<td width="25%"><div align="center"><a class='lightbox' href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"><img src="<?=$tipo_;?>" width="50" height="40" border="0"  alt='Clique para ampliar'></a> </div></td>

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Bom, está faltando o principal: Você utilizar o lightbox, pois você só incluiu a biblioteca na sua página.

 

Vamos lá :

 

1 - Você pode utiliza a seguinte função lightbox dentro da uma tag script:

 

 

 

<script type="text/javascript">
$(function() {
	$('a.lightbox').lightBox(); // Seleciona todos os links com a classe lightbox	
});
</script>


 

 

2 - Mude a parte do código onde tem a sua imagem em miniatura para

 

<td width="25%"><div align="center"><a class='lightbox' href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"><img src="<?=$tipo_;?>" width="50" height="40" border="0"  alt='Clique para ampliar'></a> </div></td>

 

 

 

 

não deu certo. as fotos continuam abrindo no arquivo foto.php e não com lightbox. o endereço dessa página é

 

http://claudirimoveis.com.br/dados.php?imovel=0009

Compartilhar este post


Link para o post
Compartilhar em outros sites

Use um debug para ver se os scripts foram iniciados corretamente! (Firebug, Webdeveloper) as vezes tem algum erro de sintaxe no seu javascript que esteja impedindo todo o resto de funcionar ;-)

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente assim:

 

 

 <td width="25%"><div align="center">
<a class='lightbox' href="<?=$tipo_;?>"><img src="<?=$tipo_;?>" width="50" height="40" border="0"  alt='Clique para ampliar'></a>
 

<a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"></a>
</div></td>

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Tente assim:

 

 

 <td width="25%"><div align="center">
<a class='lightbox' href="<?=$tipo_;?>"><img src="<?=$tipo_;?>" width="50" height="40" border="0"  alt='Clique para ampliar'></a>
 

<a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"></a>
</div></td>

 

 

Infelizmente não deu ainda. ele abriu em foto.php sem o lightbox e sumiu as miniaturas das outras fotos :(

Compartilhar este post


Link para o post
Compartilhar em outros sites

perae vamos por partes...voce quer abrir estas fotos como? sem o popup? ou seja voce quer abiri esta foto desse estilo aqui:

 

http://lokeshdhakar.com/projects/lightbox2/

 

(clique nas fotos)

 

caso voce deseja abrir neste estilo,eu acho que tem um erro ali no seu link:

 

<a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"></a>

 

 

diz que voce deseja abrir em uma outra janela com 640 de width e 620 de height! agora se quiser abrir daquele estilo sem abrir novas janelas,somente uma janala dentro da outra ai no caso vc me da mais detalhes!

Compartilhar este post


Link para o post
Compartilhar em outros sites


Não esqueça que aqui são 2 links um com lightbox e outro sem o lightbox, clique no link onde tem a classe Lightbox e faça um debug na sua aplicação para ver o que ocorre. (Você pode usar o Console do Google Chrome clicando F12 e vendo qual erro aparece)

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Não esqueça que aqui são 2 links um com lightbox e outro sem o lightbox, clique no link onde tem a classe Lightbox e faça um debug na sua aplicação para ver o que ocorre. (Você pode usar o Console do Google Chrome clicando F12 e vendo qual erro aparece)

 

 

coloquei lá o primeiro código, com lightbox, veja no link como as fotos aparecem. http://claudirimoveis.com.br/dados.php?imovel=0009

uma foto abre em outra janela, normal, mas sem lightbox, a outra abre como antes no arquivo foto.php

 

perae vamos por partes...voce quer abrir estas fotos como? sem o popup? ou seja voce quer abiri esta foto desse estilo aqui:

 

http://lokeshdhakar.com/projects/lightbox2/

 

(clique nas fotos)

 

caso voce deseja abrir neste estilo,eu acho que tem um erro ali no seu link:

 

<a href="javascript:janela1('foto.php?foto=<?=$mostra_resultado->link;?>&tipo=aluguel&imovel=<?=$cod_imovel?>','640','620')"></a>

 

 

diz que voce deseja abrir em uma outra janela com 640 de width e 620 de height! agora se quiser abrir daquele estilo sem abrir novas janelas,somente uma janala dentro da outra ai no caso vc me da mais detalhes!

 

 

eu quero que abra como neste site que vc me mandou, não no foto.php

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aaaai sim! Agora entendi pois vem a primeira coisa que vc ira fazer e naquele link vc ira fazer o download daquele prijeto segunda coisa vc ira abir o index.html existente dentro da aquele projeto e ira estudar...ja te adiantando vc nao ira chamar mais aquela funcao janela 1 pois e ela que fax abrir em uma outra janela!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom, identifiquei seu problema. Vamos por parte:

 

1 - Não sei de onde você conseguiu esse lightbox.js mas não funciona. Então troque pelo lightbox abaixo (pode usa-lo localmente):

 

 
<script src="http://leandrovieira.com/projects/jquery/lightbox/js/jquery.lightbox-0.5.pack.js" /></script>
<link href="http://leandrovieira.com/projects/jquery/lightbox/css/jquery.lightbox-0.5.css" rel="stylesheet" />

 

2 - Depois como nosso amigo Micillini Roll falou você precisa agrupar as fotos, então mude a função lightbox para

 

 
<script type="text/javascript">
$(function() {
$('#gallery .lightbox').lightBox(); // Select all links with lightbox class
});
</script>

 

3 - Adicione a tabela com as fotos dentro da div abaixo

 

 <div id='gallery'>
   <Table ...
</div>

 

4 - Por fim na fotos você faz:

 

 

 
<td width="25%"><div align="center"><a class='lightbox' href="http://www.claudirimoveis.com.br/fotos/0009%20%282%29.jpg"><img src="http://www.claudirimoveis.com.br/fotos/0009%20%282%29.jpg" width="50" height="40" border="0"  alt='Clique para ampliar'></a></div></td>                

 

obs: Troque o link pela sua variavel em PHP

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha seguinte eu fiz uns testes aqui pra te ajudar olha faz o seguinte a primeira coisa que voce devera fazer é adicionar ao seu projeto estes comandos

 

ESTE NO INICIO DO CODIGO

<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" />	<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

ESTE NO FINAL DE TODO O CODIGO

<script src="js/jquery-1.7.2.min.js"></script><script src="js/jquery-ui-1.8.18.custom.min.js"></script><script src="js/jquery.smooth-scroll.min.js"></script><script src="js/lightbox.js"></script><script>  jQuery(document).ready(function($) {      $('a').smoothScroll({        speed: 1000,        easing: 'easeInOutCubic'      });      $('.showOlderChanges').on('click', function(e){        $('.changelog .old').slideDown('slow');        $(this).fadeOut();        e.preventDefault();      })  });  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-2196019-1']);  _gaq.push(['_trackPageview']);  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();</script>

 

Agora eu adicionei um link com uma imagem:

 

 

<?$imagem = "negro.png";?><a href="<?=$imagem; ?>" rel="lightbox"><img src="<?=$imagem; ?>" width="50" height="60" /></a>

 

 

no caso o meu href esta o diretorio da imagem ele no caso tem um "rel" e dentro deste link tem uma foto em miniatura da imagem...

 

OBS: lembrando que devera existir os plugins do javascript e do css dentro da pasta do seu projeto,estes plugins estao localizados dentro dos arquivos do lightbox,os mesmos arquivos que vc baixou!

 

agora é apartir deste pequeno teste simples voce aplicar em seu projeto!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom, identifiquei seu problema. Vamos por parte:

 

1 - Não sei de onde você conseguiu esse lightbox.js mas não funciona. Então troque pelo lightbox abaixo (pode usa-lo localmente):

 

 
<script src="http://leandrovieira.com/projects/jquery/lightbox/js/jquery.lightbox-0.5.pack.js" /></script>
<link href="http://leandrovieira.com/projects/jquery/lightbox/css/jquery.lightbox-0.5.css" rel="stylesheet" />

 

2 - Depois como nosso amigo Micillini Roll falou você precisa agrupar as fotos, então mude a função lightbox para

 

 
<script type="text/javascript">
$(function() {
$('#gallery .lightbox').lightBox(); // Select all links with lightbox class
});
</script>

 

3 - Adicione a tabela com as fotos dentro da div abaixo

 

 <div id='gallery'>
   <Table ...
</div>

 

4 - Por fim na fotos você faz:

 

 

 
<td width="25%"><div align="center"><a class='lightbox' href="http://www.claudirimoveis.com.br/fotos/0009%20%282%29.jpg"><img src="http://www.claudirimoveis.com.br/fotos/0009%20%282%29.jpg" width="50" height="40" border="0"  alt='Clique para ampliar'></a></div></td>                

 

obs: Troque o link pela sua variavel em PHP

 

 

:( ainda não deu. a foto abre na mesma janela e sem lightbox. veja como está o código agora:

 

 

 

 

 

<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Informações do Imóvel</title>
<script type="text/javascript">
$(function() {
$('#gallery .lightbox').lightBox(); // Select all links with lightbox class
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.auto-style1 {
border-width: 0;
}
</style>
</head>
<script>
<!--
function janela1(str,w,h)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
win = window.open(str, 'tipWin1', winprops)
}
-->
</script>
<script>
<!--
function janela3(str,w,h)
{
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl
win = window.open(str, 'tipWin1', winprops)
}
-->
</script>
<body>
<br>
<br>
<div align="center">
<table width="733" border="0" cellpadding="0" cellspacing="0" bordercolor="#D1D1D1" class="auto-style1">
<tr>
<td bgcolor="#D2E28B" style="height: 19px">
<div align="center"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Imóvel: <b>
<?
$cod_imovel=$imovel;
echo $cod_imovel;
include('data.php');
$resultado=mysql_query("select * from imoveis where imovel='$cod_imovel'");
$mostra_resultado=mysql_fetch_object($resultado);
?>
</b></font></div></div></td>
<td width="258" bgcolor="#D2E28B" style="height: 19px">
<div align="center"></div></td>
</tr>
<tr>
<td width="475" height="162"><table width="98%" height="145" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="11" height="141"><div align="right"> </div></td>
<td width="225"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><? print $mostra_resultado->descr; ?></font></strong></td>
<td width="12"><p> </p>
<p> </p></td>
<td width="208" height="100%"><p><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Tabela de preços
(valor por dia):</font></p>
<p><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <? print $mostra_resultado->vlrper; ?></font></p>
<p><font size="1" face="Verdana">obs: será cobrada a parte uma taxa
única de limpeza para o período locado (valor sob consulta).</font></p>
<p><a href="javascript:janela3('google.php?g1=<?=$mostra_resultado->g1;?>&g2=<?=$mostra_resultado->g2;?>&imovel=<?=$cod_imovel?>','640','480')">
<img src="imagens/maps.jpg" width="150" height="20" border="0"></a></p></td>
</tr>
</table></td>
<td height="162" >
<div id="gallery">
<table width="78%" border="0" align="center" cellpadding="0" cellspacing="6" valign="top">
<tr><?//////////////////////////////////////////////////////////////////?>
<? //$link=mysql_connect("localhost", "root" ,"");
//mysql_select_db("james", $link);
$sql=("select * from fotos where (imovel='$cod_imovel') ORDER BY Id");
$resultado=mysql_query($sql) or die (mysql_error());
$indica_linha=0;
echo "<tr>";
if (mysql_num_rows($resultado) == 0){
echo "<br>\n";
echo "<td valign='top'><div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Este imóvel não possui fotos !!!</font></div></td>\n";
}else{
?>
<b>
<div align='center'><font size='1' face='Verdana, Arial, Helvetica, sans-serif'>Clique nas fotos para ampliar</font></div></b>
<?
}
for ($x=1; $x<=(mysql_num_rows($resultado)); $x++)
{
$mostra_resultado=mysql_fetch_object($resultado);
$rest = substr($mostra_resultado->link, 33, strlen($mostra_resultado->link));
if (file_exists($rest)){
$indica_linha++;
if($indica_linha > 4)
{
print ("</TR><TR>");
$indica_linha=1;
}
$tipo_="";
$tipo1_="";
$teste = explode("/",$mostra_resultado->link);
$teste2=sizeof($teste);
$teste3=explode(" ",$teste[$teste2-1]);
$teste4=sizeof($teste3);
for ($i=0;$i<($teste2-1);$i++) {
$tipo_ = $tipo_.$teste[$i]."/";
}
for ($i=0;$i<($teste4);$i++) {
if ($i==$teste4-1){
$tipo1_ = $tipo1_.$teste3[$i];
}else{
$tipo1_ = $tipo1_.$teste3[$i]."%20";
}
}
$tipo1_= $tipo_.$tipo1_;
$tipo_= $tipo_.rawurlencode($teste[$teste2-1]);
?>
<td width="25%"><div align="center"><a class='lightbox' href="<?=$tipo_;?>"><img src="<?=$tipo_;?>" width="50" height="40" border="0" alt='Clique para ampliar'></a></div></td>
<?
}
}
?>
<?//////////////////////////////////////////////////////////////////?>
</tr>
</table></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D2E28B">
<div align="center"> </div></td>
</tr>
<tr>
<td colspan="2">
<?
;
include("cal.php");
?>
<table width="100%" border="0" cellspacing="2" align="left" height="34">
<tr>
<td width="84%"><div align="center"> </div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#D2E28B">
<p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="javascript:janela3('contato-reserve.php?imovel=<?=$cod_imovel?>','1039','810')"><strong>
<font color="#000000">Clique aqui para mais informações</font></strong></a></font></td>
</tr>
</table>
</div>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Faltou você adicionar o JQUERY

 

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>


O JQUERY é antes de tudo ok ? Faça a importação antes de qualquer outro arquivo JS. Ficaria assim:

 

 

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://leandrovieira.com/projects/jquery/lightbox/js/jquery.lightbox-0.5.pack.js" /></script>
<link href="http://leandrovieira.com/projects/jquery/lightbox/css/jquery.lightbox-0.5.css" rel="stylesheet" />
 
 

Compartilhar este post


Link para o post
Compartilhar em outros sites

 

Faltou você adicionar o JQUERY

 

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

 

O JQUERY é antes de tudo ok ? Faça a importação antes de qualquer outro arquivo JS. Ficaria assim:

 

 

 

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://leandrovieira.com/projects/jquery/lightbox/js/jquery.lightbox-0.5.pack.js" /></script>
<link href="http://leandrovieira.com/projects/jquery/lightbox/css/jquery.lightbox-0.5.css" rel="stylesheet" />
 
 

 

 

ainda não dá. continua abrindo na mesma janela e sem lightbox. o que será que está errado?...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tente com esse JQUERY, testei aqui e funcionou:

 

 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" type="text/javascript"></script>

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.