Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] Animate i podstawienie parametrow
comanderv
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 2.12.2008

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


witam,
mam problem z odpaleniem takiego kodu:
  1. var kierunek = 'left';
  2. var ile ='+200px';
  3.  
  4. $('#id_elementu').animate({ kierunek : ile }, 800, 'linear');

problem jest z podstawieniem zmiennej kierunek... ni jak to nie wchodzi, probowalem skladac stringa, nawet cala zawartosc { } i nic.
jakies pomysly jak to zrobic?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Kod
var kierunek = 'left';
var ile ='+200px';
var params ={};
params[kierunek] = ile;

$('#id_elementu').animate(params, 800, 'linear');
Go to the top of the page
+Quote Post
comanderv
post
Post #3





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 2.12.2008

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


no o tym bym nie pomyslal, dzieki (IMG:style_emoticons/default/smile.gif)
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: 26.09.2025 - 18:12