Kai345: Element ein-, ausblenden

Beitrag lesen

[latex]Mae  govannen![/latex]

<a href="#" onclick="blocks_an_aus ('box01','box02','box03','box04') ;return false">TEST</a>

Du übergibst hier 4 Parameter: 'box01','box02','box03','box04'

die du hier

function blocks_an_aus (myIds, aktion) {

in Variable packen willst. Somit hat die Variable myIds den String 'box01' zugewiesen bekommen und die Variable aktion wurde mit
'box02' belegt.

In der Funktion hast du aber

var IdArr = myIds.split(" ");

also willst du am Leerzeichen trennen. Also übergib die Werte entsprechen in _einem_ Parameter mit Leerzeichen getrennt.

Ich halte aber auch diese Vorgehenweise für nicht optimal, besser wäre eine Funktion, die als ersten Parameter die Aktion enthält und als weitere Parameter (beliebige Menge) dann die IDs.  Auslesen über arguments bzw arguments.length, dann sparst du dir den unnötigen Umweg mit split etc. und must von arguments.length nur 1 abziehen für den ersten Parameter (aktion)

Cü,

Kai

--
Ash nazg durbatulûk, ash nazg gimbatul,ash nazg thrakatulûk, agh burzum-ishi krimpatul
Sacrifice - the future has it's price
And today is only yesterday's tomorrow
selfcode sh:( fo:| ch:? rl:( br:< n4:# ie:{ mo:| va:) js:) de:> zu:) fl:( ss:| ls:?
0 75

deaktiviertes layer,Scrollbalken bleibt sichtbar opera sichtbar

Insomnia
  • css
  1. 0
    Detlef G.
    1. 0
      Insomnia
      1. 0
        Detlef G.
        1. 0
          Insomnia
      2. 0
        Insomnia
        1. 0
          Detlef G.
          1. 0
            Insomnia
            1. 0
              Detlef G.
              1. 0
                Insomnia
                1. 0
                  Insomnia
                  1. 0
                    Insomnia
                    1. 0
                      Detlef G.
                      1. 0
                        Insomnia
                        1. 0
                          Insomnia
                          1. 0

                            Element ein-, ausblenden

                            Detlef G.
                            • javascript
                            1. 0
                              Insomnia
                              1. 0
                                Detlef G.
                                1. 0
                                  Insomnia
                                  1. 0
                                    Insomnia
                                    • css
                                  2. 0
                                    Detlef G.
                                    1. 0
                                      Insomnia
                                      1. 0
                                        Insomnia
                                      2. 0
                                        Detlef G.
                                        1. 0
                                          Detlef G.
                                          1. 0
                                            Insomnia
                                        2. 0
                                          Insomnia
                                          1. 0
                                            Detlef G.
                                            1. 0
                                              Insomnia
                                              1. 0
                                                Beat
                                                1. 0
                                                  Detlef G.
                                                2. 0
                                                  Insomnia
                                              2. 0
                                                Detlef G.
                                                1. 0
                                                  Insomnia
                                                  1. 0
                                                    Detlef G.
                                                    1. 0
                                                      Insomnia
                                                      1. 0
                                                        Detlef G.
                                                        • sonstiges
                                                        1. 0
                                                          Insomnia
                                                        2. 0
                                                          Insomnia
                                                        3. 0
                                                          Insomnia
                                                        4. 0
                                                          Insomnia
                                                          • javascript
                                                          1. 0
                                                            Kai345
                                                            1. 0
                                                              Kai345
                                                              1. 0
                                                                Insomnia
                                                                1. 0
                                                                  Kai345
                                                                2. 0
                                                                  Detlef G.
                                                                  1. 0
                                                                    Insomnia
                                                              2. 0
                                                                Detlef G.
                                                                1. 0
                                                                  Kai345
                                                                  1. 0
                                                                    Detlef G.
                                                                    1. 0
                                                                      Kai345
                                                                      1. 0
                                                                        Insomnia
                                                                        1. 0
                                                                          Insomnia
                                                                          1. 0
                                                                            Detlef G.
                                                                            1. 0
                                                                              Kai345
                                                                              1. 0
                                                                                Insomnia
                                                                                1. 0
                                                                                  Insomnia
                                                                                  1. 0
                                                                                    Insomnia
                                                                                    1. 0
                                                                                      Detlef G.
                                                                                      1. 0
                                                                                        Insomnia
                                                                              2. 0
                                                                                Detlef G.
                                                                                1. 0
                                                                                  Kai345
                                                                      2. 0
                                                                        Detlef G.
                                                                        1. 0
                                                                          Kai345
                                                                          1. 0
                                                                            Detlef G.
                                                                            1. 0
                                                                              Kai345
                                                      2. 0
                                                        Detlef G.
                                                        1. 0
                                                          Insomnia
                                                          1. 0
                                                            Detlef G.
                                                            1. 0
                                                              Insomnia
                                                              1. 0
                                                                Detlef G.
                                                                1. 0
                                                                  Insomnia
                                                                  1. 0
                                                                    Detlef G.
                                                                    1. 0
                                                                      Insomnia
                      2. 0
                        Insomnia