Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jquery]zmiany klasy po id
trucksweb
post
Post #1





Grupa: Zarejestrowani
Postów: 1 199
Pomógł: 31
Dołączył: 22.03.2004
Skąd: Warszawa

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


czy jest mozliwosc aby zmienic nazwe klasy elementowi po jego wartosci id ?

robie vcos takiego:
  1. var pole = $(this).attr('id');
  2. $(pole).removeClass("kolor");


gdzie pole przyjmuje nazwe id z elementu np. diva, ale juz nie dziala removeClass ? (IMG:http://forum.php.pl/style_emoticons/default/blinksmiley.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
l1em1on1
post
Post #2





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 15.10.2008

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


naprawde nie rozumiem po co tyle kombinowania...
  1. $(function() {
  2. $(".glowna .minus").click(
  3. function() {
  4. $(this).removeClass("minus");
  5. $(this).addClass("plus");
  6. $("#ukryj").toggle("fast");
  7. alert($(this).attr('id'));
  8. }
  9. });
  10. });

i podobnie dla plus

po kliknieciu na jakis element o klasach glowna i minus

dany element i tylko on co oznacza this...
robi te zmiany klas[html][/html]

Ten post edytował l1em1on1 16.10.2008, 11:17:18
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: 14.10.2025 - 15:58