Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Java][CSS]powtarza 2 razy funkcję
neo1986kk
post
Post #1





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

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


  1.  
  2. echo '<div class="friendAddK" id="check'.$row[0].'" style="position: relative; background:none;">';
  3. echo '<label onclick="Fcheck('.$row[0].');" style="display: block; width: 100px; height: 100px; cursor: pointer; position: relative; z-index: 9;"><input type="checkbox" name="friendOnK[]" ></input></label>';
  4.  
  5.  



javascript
  1. function Fcheck(check)
  2. {
  3.  
  4. alert('sprawdz');
  5.  
  6.  
  7. div=document.getElementById('check'+check);
  8. if(div.style.background=='none repeat scroll 0% 0% transparent')
  9. {
  10. div.style.background='#002348';
  11. }
  12. else div.style.background='none repeat scroll 0% 0% transparent';
  13. }
  14.  


i jest tak, że jak kliknę to 2 x pojawia sie alert i oczywiście nie zmienia się kolor tła, chociaż jakieś pół godziny temu to działało.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
darko
post
Post #2





Grupa: Zarejestrowani
Postów: 2 885
Pomógł: 463
Dołączył: 3.10.2009
Skąd: Wrocław

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


Sprawdź, co się kryje tutaj:
[JAVASCRIPT] pobierz, plaintext
  1. alert(div.style.background);
[JAVASCRIPT] pobierz, plaintext

i tutaj:
  1. <?php
  2. print_r($row[0]);

Swoją drogą to takie magiczne, że coś nagle znika, prawda ;]
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 Aktualny czas: 10.10.2025 - 12:52