![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 466 Pomógł: 11 Dołączył: 21.09.2006 Skąd: Szczecin Ostrzeżenie: (0%) ![]() ![]() |
mam kod html:
i JS: Kod var div1=document.getElementById('first'); var div2=document.getElementById('second'); function show1(){ div1.style.display="block"; div2.style.display="none"; } function show2(){ div1.style.display="none"; div2.style.display="block"; } Lecz po kliknięciu w link, nic się nie dzieje? Co nie tak w kodzie jest? |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 8 989 Pomógł: 1550 Dołączył: 8.08.2008 Skąd: Słupsk/Gdańsk ![]() |
Jak znam zycie to dales ten kod w sekcji head. I juz w tej sekcji probuje pobrac elementy ale one jeszcze nie istnieja.
wstaw Kod var div1=document.getElementById('first'); w srodek tych 2 funkcji.
var div2=document.getElementById('second'); -------------------- |
|
|
![]()
Post
#3
|
|
![]() Grupa: Zarejestrowani Postów: 466 Pomógł: 11 Dołączył: 21.09.2006 Skąd: Szczecin Ostrzeżenie: (0%) ![]() ![]() |
podziękować
![]() |
|
|
![]()
Post
#4
|
|
![]() Grupa: Zarejestrowani Postów: 217 Pomógł: 40 Dołączył: 20.08.2008 Ostrzeżenie: (0%) ![]() ![]() |
Nie deklaruj zmiennych poza cialem funkcji, przeciez mozna zrobic to owiele latwiej :
CODE function show1(){ document.getElementById("first").style.display="block"; document.getElementById("second").style.display="none"; } function show2(){ document.getElementById("first").style.display="none"; document.getElementById("second").style.display="block"; } Sie spoznilem... Ten post edytował ikssde 28.08.2008, 12:25:05 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 20.08.2025 - 10:03 |