Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [mootools]problemy z innym skryptem, po dołączeniu biblioteki mootools
Black-Berry
post
Post #1





Grupa: Zarejestrowani
Postów: 663
Pomógł: 6
Dołączył: 3.06.2007
Skąd: Kraków

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


Miałem kiedyś taki skrypt do obsługi zakładek. Pokazywałem go nawet na forum. Teraz dodałem do jednej strony swój skrypt oraz bibliotekę mootools i zrobiło się nieprzyjemnie (IMG:http://forum.php.pl/style_emoticons/default/worriedsmiley.gif) Oto mój kod:
  1. <?php
  2. var Edicra;
  3. if (!Edicra) Edicra = {};
  4.  
  5. Edicra.TabbedPanel = function(element, tabId)
  6. {
  7.    this.startingTab = tabId;
  8.    this.currentTab = this.startingTab;
  9.    this.element2 = document.getElementById(element);
  10.    allChildren = this.getElementChildren(this.element2);
  11.    this.tabs = this.getElementChildren(allChildren[0]);
  12.    this.panels = this.getElementChildren(allChildren[1]);
  13.    for (var i in this.tabs) {
  14.        if (i == this.startingTab) {
  15.            this.tabs[i].className = 'selected';
  16.        } else {
  17.            if (i == this.currentTab) {
  18.                this.panels[i].style.display = 'block';
  19.            } else {
  20.                this.panels[i].style.display = 'none';
  21.            }
  22.        }
  23.    }
  24. }
  25.  
  26. (..)
  27.  
  28. Edicra.TabbedPanel.prototype.getElementChildren = function(element)
  29. {
  30.    var children = [];
  31.    var child = element.firstChild;
  32.    while (child) {
  33.        if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
  34.            children.push(child);
  35.        child = child.nextSibling;
  36.    }
  37.    return children;
  38. };
  39. ?>


Przeglądarka wyświetla bład: this.tabs[i] is not an object. Po wuunięciu mootoolsa wszystko działa OK. Moze ktoś się z czymś takim spotkał. Błagam o pomoc.
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: 22.08.2025 - 16:27