Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Przycisk i jQuery
koxu1996
post
Post #1





Grupa: Zarejestrowani
Postów: 139
Pomógł: 3
Dołączył: 5.06.2011

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


Witam. Mam problem z przyciskiem. Jego kod:
  1. <a class="button button_click" rel="10">KLIK</a>

Później w jQuery:
  1. ...
  2. $('button button_click').live("click", function () {
  3. ...


Lecz nie działa. Co jest nie tak?
Go to the top of the page
+Quote Post
Sebek87
post
Post #2





Grupa: Zarejestrowani
Postów: 74
Pomógł: 24
Dołączył: 21.10.2012
Skąd: Puławy

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


Po pierwsze to nie button tylko zwykły link w dodatku z błedem, bo zgubiłeś href.
  1. $('.button_click').live("click", function () {


Ten post edytował Sebek87 25.11.2012, 15:48:44
Go to the top of the page
+Quote Post
ensei
post
Post #3





Grupa: Zarejestrowani
Postów: 50
Pomógł: 4
Dołączył: 30.04.2008

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


  1. $('.button_click').live("click", function () {
Go to the top of the page
+Quote Post
cudny
post
Post #4





Grupa: Zarejestrowani
Postów: 387
Pomógł: 66
Dołączył: 31.03.2005
Skąd: Kielce

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


Cytat(ensei @ 25.11.2012, 15:48:21 ) *
  1. $('.button_click').live("click", function () {



As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().

http://api.jquery.com/live/
Go to the top of the page
+Quote Post

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: 23.08.2025 - 15:36