Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Przycisk i jQuery
koxu1996
post 25.11.2012, 15:43:44
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 25.11.2012, 15:48:00
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 25.11.2012, 15:48:21
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 27.11.2012, 20:56:17
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/


--------------------
..::: Jak pomogłem to kliknij pomógł. Tak rzadko używacie tej opcji :( :::..
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 28.06.2025 - 08:19