Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]zatzymac zmienna...
Kamil Pietrzak
post
Post #1





Grupa: Zarejestrowani
Postów: 213
Pomógł: 10
Dołączył: 7.01.2010
Skąd: Lublin

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


witem

  1.  
  2. <script type="text/javascript">
  3. function FormFocusHover(act, id)
  4.  
  5. {
  6. var CSSClass;
  7. CSSClass = document.getElementById(id).className;
  8. if(act == 1)
  9. {document.getElementById(id).className = CSSClass+'_jsHover'; }
  10. if(act == 0)
  11. {document.getElementById(id).className = CSSClass;}
  12.  
  13. }
  14.  


mam taka funkcje js

i wywolanie

  1. <input type="text" name="nick" class="add_coment" id="nickname" onfocus="FormFocusHover(1, 'nickname');" onblur="FormFocusHover(0, 'nickname');" /><br />


jak cos to sens jest taki, ze gdy klawiatura jest na kontrolce to ma inna klase, jest podswietlona

wszystko fajnie, tylko dziala do momentu zdjecia klawiatury
pozniej zmienna CSSClass ma juzi nna wartosc, gdy dam klawuatire jeszcze raz to doda sie nowe '_jsHover' ('_jsHover_jsHover_jsHover_jsHover')
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.08.2025 - 21:54