Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problemy z przeglądarką zdięć
dark_root
post 30.05.2009, 18:07:09
Post #1





Grupa: Zarejestrowani
Postów: 341
Pomógł: 1
Dołączył: 19.11.2007

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


To jest element mojej przeglądarki zdjęć w js.
Kod
document.write(
        '<form action="javascript:void(0)" id="' + this.id + '" class="zdjecia">' +
            '<div class="zdjecia_menu">' +
                '<input type="button" name="poczatek" value="|&lt;&lt;"' + (nr == 0 ? ' disabled="disabled"' : '') + ' title="Początek" onclick="' + this.id + '.wyswietl(0)" onkeypress="' + this.id + '.wyswietl(0)" />' +
                '<input type="button" name="wstecz" value="  &lt;&lt;  "' + (nr == 0 ? ' disabled="disabled"' : '') + ' title="Wstecz" onclick="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].selectedIndex - 1)" onkeypress="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].selectedIndex - 1)" />' +
                ' <select name="zdjecia" onchange="' + this.id + '.wyswietl(this.selectedIndex)">' +
                    html +
                '</select> ' +
                '<input type="button" name="dalej" value="  &gt;&gt;  "' + (nr == zdjecia.length - 1 ? ' disabled="disabled"' : '') + ' title="Dalej" onclick="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].selectedIndex + 1)" onkeypress="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].selectedIndex + 1)" />' +
                '<input type="button" name="koniec" value="&gt;&gt;|"' + (nr == zdjecia.length - 1 ? ' disabled="disabled"' : '') + ' title="Koniec" onclick="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].options.length - 1)" onkeypress="' + this.id + '.wyswietl(this.form.elements[\'zdjecia\'].options.length - 1)" />' +
                '<div><input type="checkbox" name="auto"' + (auto ? ' checked="checked"' : '') + ' id="' + this.id + '__auto" onclick="' + this.id + '.przewin()" onkeypress="' + this.id + '.przewin()" style="vertical-align: middle" /> <label for="' + this.id + '__auto">Pokaz slajdów</label></div>' +
            '</div>' +
            '<a href="' + zdjecia[nr][0] + '" rel="lightbox-cats"><img id="' + this.id + '__img" src="' + zdjecia[nr][0] + '" alt="" title="Dalej..."/></a>' +
            '<div class="zdjecia_opis" id="' + this.id + '__opis">' + (typeof zdjecia[nr][2] != 'undefined' ? zdjecia[nr][2]: '') + '</div>' +
        '</form>'
    );


Problem polega na tym, że jak przewijam kolejne zdjęcia do przodu zmieniają się tylko miniaturki, natomiast odnośnik do większych zdjęć się nie zmienia, lecz jest stały, pomimo, iż używam tej samej zmiennej. Chodzi o ten kawałek
Kod
<a href="' + zdjecia[nr][0] + '" rel="lightbox-cats"><img id="' + this.id + '__img" src="' + zdjecia[nr][0] + '" alt="" title="Dalej..."/></a>
W ścieżce obrazka zdjecia[nr][0] się zmiania a w odnośniku zdjecia[nr][0] cały czas równa się tyle samo a 0 powinno się zmieniać. Dlaczego tak jest?
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: 26.06.2025 - 09:09