Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Piwo (naprawdę) za rozwiązanie problemu, Przelewam 10 PLN na piwo na wskazane konto
swmikolaj21
post 18.05.2008, 17:43:25
Post #1





Grupa: Zarejestrowani
Postów: 36
Pomógł: 0
Dołączył: 11.05.2005

Ostrzeżenie: (0%)
-----


Witam,

Mam pilny problem do rozwiązania, treść poniżej. Dla osoby, która poda rozwiązanie problemu i wyjaśni jego przyczyny stawiam piwo! Prawdziwe, nie wirtualne, przeleję 10 złoty (myślę, że wystarczy nawet na dwa), a osoba potwierdzi na forum, że otrzymała $$ i spija właśnie piwko.... smile.gif


Pomóżcie proszę:

Bardzo słabo rozumiem JS, a mam taki problem z galerią, która działa tylko w FF. Po rozpoczęciu przeglądania zdjęć od danego zdjęcia z ustalonym id nie działają pliki następny, poprzedni itp.
oto strona: http://latayachts.pl/galeria.php?id=21

Wydaje mi się, że jest jakiś problem z przekazaniem ID zdjęcia (gdy brak parametru id wszystko jest OK)

Oto problematyczny kod:
  1. var gallery6 = [
  2. "img/full/foto34.jpg",
  3. "img/full/foto33.jpg",
  4. "img/full/foto32.jpg",
  5. "img/full/foto0711.jpg",
  6. "img/full/foto0705.jpg",
  7.  
  8. ];
  9.  
  10.  
  11. var galleries = [gallery1, gallery2, gallery3, gallery4, gallery5, gallery6,];
  12. var gallery = null;
  13. var galleryIdx = null;
  14. var slideInterval = null;
  15. var langID = "pl";
  16.  
  17. function GalleryImageID() {
  18. if (galleryIdx == null)
  19. return "0705";
  20. var img = gallery[galleryIdx];
  21. if (typeof img == "object")
  22. img = img.src;
  23. return img.replace(/^.*\/img\/full\/foto(.+)\.jpg$/, "$1");
  24. }
  25.  
  26. function GalleryInit() {
  27. var curImg = document.getElementById("CurrentImage");
  28. var curName = curImg.src;
  29.  
  30. curName = curName.substr(curName.lastIndexOf("/") + 1);
  31. for (var j = 0; j < galleries.length && galleryIdx == null; ++j) {
  32. gallery = galleries[j];
  33. for (var i = 0; i < gallery.length; ++i)
  34. if (gallery[i].indexOf(curName) >= 0) {
  35. galleryIdx = i;
  36. gallery[i] = new Image();
  37. gallery[i].src = curImg.src;
  38. break;
  39. }
  40. }
  41. if (gallery.length == 1) {
  42. document.getElementById("guzik_lewy").disabled = true;
  43. document.getElementById("guzik_prawy").disabled = true;
  44. document.getElementById("panel_lewo").disabled = true;
  45. document.getElementById("panel_slajdy").disabled = true;
  46. document.getElementById("panel_czas").disabled = true;
  47. document.getElementById("panel_prawo").disabled = true;
  48. }
  49. GalleryPreload();
  50. }
  51.  
  52. function GalleryNext() {
  53. if (galleryIdx != null) {
  54. var i = galleryIdx + 1;
  55. if (i >= gallery.length)
  56. i = 0;
  57. GallerySelect(i);
  58. }
  59. }


Będę wdzięczny za wszelką pomoc
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.08.2025 - 03:43