Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] Problem z addClass()
d.stp
post
Post #1





Grupa: Zarejestrowani
Postów: 358
Pomógł: 0
Dołączył: 19.04.2012

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


Mam coś takiego:
  1. $('.slider_buttons li').click(function(){
  2. $(this).addClass("selected");
  3. });

html:
  1. <ul class="slider_buttons">
  2. <li><a title="">x1</a></li>
  3. <li><a title="">x2</a></li>
  4. </ul>

css:
  1. .selected {
  2. width: 134px;
  3. height: 97px;
  4. background: url('../images/slider-button-hover.png') no-repeat;
  5. }

Ale nie dodaje klasy po kliknięciu w <li>... dla pewności dodałem alert('x') i alert działa. Dlaczego addClass nie chce działać?

Ten post edytował d.stp 21.09.2012, 20:46:22
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: 21.08.2025 - 16:07