Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Galeria Lightbox z jednego obrazka
shpaque
post 17.07.2018, 11:24:29
Post #1





Grupa: Zarejestrowani
Postów: 651
Pomógł: 3
Dołączył: 31.01.2011
Skąd: Warszawa

Ostrzeżenie: (10%)
X----


Jak zrobic aby klikajac na jeden obrazek leciala nam galeria? Mam tak:

  1. <?php
  2. $images = glob($dirPath."/".$offer['id']."/*.jpg");
  3. foreach($images as $image): ?>
  4. <a href="#" data-lightbox="<?php echo $image; ?>" data-gallery-id="gallery" data-frame="fullscreen-lb" data-caption="<?php echo $offer -> $language -> title; ?>">
  5. <div class="col-sm-12 image" style="background-image: url(<?php echo $images[0]; ?>);"></div>
  6. <?php endforeach ?>
  7. </a>


ok udalo sie jakos, nie wime cyz dobrze ale dziala

  1. <?php
  2. if (count(glob($dirPath."/".$offer['id']."/*.jpg")) != 0)
  3. {
  4. $images = glob($dirPath."/".$offer['id']."/*.jpg");
  5.  
  6. echo "
  7. <a href=\"#\" data-lightbox=\"".$images[0]."\" data-gallery-id=\"gallery\" data-frame=\"fullscreen-lb\" data-caption=\"".$offer -> $language -> title."\">
  8. <div class=\"col-sm-12 image\" style=\"background-image: url(".$images[0]."\"></div>
  9. </a>";
  10.  
  11. foreach($images as $key => $image)
  12. {
  13. if ($key > 0)
  14. {
  15. echo "<a href=\"#\" data-lightbox=\"".$image."\" data-gallery-id=\"gallery\" data-frame=\"fullscreen-lb\" data-caption=\"".$offer -> $language -> title."\"></a>";
  16. }
  17. }
  18. }
  19. ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.04.2024 - 01:05