Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> DIV update effect, Łagodna wymiana zawartości DIVa
prond
post 8.03.2007, 09:54:16
Post #1





Grupa: Zarejestrowani
Postów: 254
Pomógł: 10
Dołączył: 8.11.2006
Skąd: Warszawa

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


Witam, czy ktoś z was może mi pomóc w stworzeniu skryptu, który wymienia zawartość DIVa AJAXem, w taki sposób, aby nie było żadnego "skakania".

Przez skakanie rozumiem przesuwanie treści pod DIVem kiedy nowa zawartość zajmuje mniej, albo więcej miejsca.

Próbowałem wykorzystać scriptaculous :
  1. <script type="text/javascript">
  2. <!--
  3. Effect.Updater = Class.create();
  4. Object.extend(Object.extend(Effect.Updater.prototype,
  5. Effect.Base.prototype), {
  6. initialize: function(element) {
  7. this.element = $(element);
  8. var options = Object.extend({
  9. duration: 0.001,
  10. newContent: ''
  11. }, arguments[1] || {});
  12. this.start(options);
  13. },
  14. loop: function(timePos) {
  15. if(timePos >= this.startOn) {
  16. Element.update(this.element,this.options.newContent);
  17. this.cancel();
  18. return;
  19. }
  20. }
  21. });
  22.  
  23. function updateSolutionsList(intProblemId)
  24. {
  25. new Effect.Fade('solutionsList', {queue : 'end'});
  26. new Effect.Updater('solutionsList', {newContent : $('Ajax-Loader').innerHTML, queue : 'end'});
  27. new Effect.Appear('solutionsList', {queue : 'end'});
  28.  
  29. new Ajax.Request('/Solutions/index/'+intProblemId, {
  30. onComplete: function (response) {
  31. new Effect.Fade('solutionsList', {queue : 'end'});
  32. new Effect.Updater('solutionsList', {newContent : response.responseText, queue : 'end'});
  33. new Effect.Appear('solutionsList', {queue : 'end'});
  34. }
  35. });
  36. }
  37. //-->


Wszystko niby ładnie, ale potrzebuje jeszcze płynnego efektu do zmiany wysokości DIVa.


--------------------
--------------------------------------------------------------------------------
weblog.axent.pl
--------------------------------------------------------------------------------
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 14:42