Duvida ! < Foto anterior II Próxima Foto >
Ola tudo bem estou com um pequeno problema com um código e como não entendo muito da área do js ... java gostaria de pedir ajuda aos colegas do grupo
ele deveria abrir a imagem grande ao clicar em um thumb e também passar as imagens tanto para < esq quanto dir >
<script>
$(function(){
$('.thumbs a').click(function (e) {
e.preventDefault();
var cover = $('.cover img');
var thumb = $(this).attr('href');
cover.fadeTo('200', '0', function () {
cover.attr('src', thumb);
cover.fadeTo('150', '1');
});
$('.thumbs img').removeClass('active');
$(this).addClass('active');
});
$('.details-photos-next').click(function (e) {
var thumb = $('a[href="'+$('.cover img').attr('src')+'"').next();
if (thumb.length == 0)
thumb = $('a[href="'+$('.cover img').attr('src')+'"').parent().find('a').first();
thumb.click();
});
$('.details-photos-prev').click(function (e) {
var thumb = $('a[href="'+$('.cover img').attr('src')+'"').prev();
if (thumb.length == 0)
thumb = $('a[href="'+$('.cover img').attr('src')+'"').parent().find('a').last();
thumb.click();
});
});
</script>
na div thumb tenho o seguinte código
<div class="thumbs">
<? if ($foto1 != "produtos/"){ ?>
<a href="thumb.php?imagem=<? print $foto1;?>&x=640">
<?php
print "<img src='thumb.php?imagem=$foto1&x=75' border='0'>";
?>
</a>
<?php } ?>
<? if ($foto2 != "produtos/"){ ?>
<a href="thumb.php?imagem=<? print $foto2;?>&x=640">
<?php
print "<img src='thumb.php?imagem=$foto2&x=75' border='0'>";
?>
</a>
<?php } ?>
<? if ($foto3 != "produtos/"){ ?>
<a href="thumb.php?imagem=<? print $foto3;?>&x=640">
<?php
print "<img src='thumb.php?imagem=$foto3&x=75' border='0'>";
?>
</a>
<?php } ?>
<? if ($foto4 != "produtos/"){ ?>
<a href="thumb.php?imagem=<? print $foto4;?>&x=640">
<?php
print "<img src='thumb.php?imagem=$foto4&x=75' border='0'>";
?>
</a>
<?php } ?>
</div>
Na janela grande onde teria que abrir a imagem ampliada esse seria o código
<td width="670" height="480" align="center">
<div class="details-photos-box">
<div class="details-photos-prev">
<span> ‹ </span>
</div>
<img src="thumb.php?imagem=<? print $foto1;?>&x=640'" border="0"/>
<div class="details-photos-next">
<span> › </span>
</div>
</div>
</td>Discussão (1)
Carregando comentários...