logo
11.06.2020 10:36
1
Ahoj,

už se s tím peru celkem dlouho, a nejde mi to nějak na rozum... dle mého to mám správně, a stejně to nefunguje jak má.

Kód přikládám - jde o to, že když zvolím z otevřené sekce R17, sekci R18 - R17 by se měla hned zavřít. A naopak.


PHP kód:
<div id="accordion">
  <
div class="card">
    <
div class="card-header" id="heading-1">
      <
h5 class="mb-0">
        <
a role="button" data-toggle="collapse" href="#collapse-1" aria-expanded="false" aria-controls="collapse-1" class="collapsed">
         Do 
R17
        
</a>
      </
h5>
    </
div>
    <
div id="collapse-1" class="collapse" data-parent="#accordion" aria-labelledby="heading-1" style="">
      <
div class="card-body">

        <
div id="accordion-1">
          <
div class="card">
            <
div class="card-header" id="heading-1-1">
              <
h5 class="mb-0">
                <
class="" role="button" data-toggle="collapse" href="#collapse-1-1" aria-expanded="true" aria-controls="collapse-1-1">
                 
Pneumatiky zakoupím u vás
                
</a>
              </
h5>
            </
div>
            <
div id="collapse-1-1" class="collapse show" data-parent="#accordion-1" aria-labelledby="heading-1-1" style="">
              <
div class="card-body">

                  <
div id="accordion-1-1">
                    <
div class="card">
                      <
div class="card-header" id="heading-1-1-1">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-1-1" aria-expanded="false" aria-controls="collapse-1-1-1">
                           
1 kolo 
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-1-1" class="collapse" data-parent="#accordion-1-1" aria-labelledby="heading-1-1-1">
                        <
div class="card-body">
                          
Text 1 &gt&gt1
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-1-1-2">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-1-2" aria-expanded="false" aria-controls="collapse-1-1-2">
                           
2 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-1-2" class="collapse" data-parent="#accordion-1-1" aria-labelledby="heading-1-1-2">
                        <
div class="card-body">
                          
Text 1 &gt&gt2
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-1-1-3">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-1-3" aria-expanded="false" aria-controls="collapse-1-1-3">
                           
3 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-1-3" class="collapse" data-parent="#accordion-1-1" aria-labelledby="heading-1-1-3">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                       <
div class="card">
                      <
div class="card-header" id="heading-1-1-4">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-1-4" aria-expanded="false" aria-controls="collapse-1-1-4">
                           
Kompletní služba 4 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-1-4" class="collapse" data-parent="#accordion-1-1" aria-labelledby="heading-1-1-4">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                  </
div>

              </
div>
            </
div>
          </
div>
          <
div class="card">
            <
div class="card-header" id="heading-1-2">
              <
h5 class="mb-0">
                <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-2" aria-expanded="false" aria-controls="collapse-1-2">
                  
Pneumatiky mám vlastní
                
</a>
              </
h5>
            </
div>
           <
div id="collapse-1-2" class="collapse" data-parent="#accordion-1" aria-labelledby="heading-1-2">
              <
div class="card-body">

                  <
div id="accordion-1-2">
                    <
div class="card">
                      <
div class="card-header" id="heading-1-2-1">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-2-1" aria-expanded="false" aria-controls="collapse-1-2-1">
                           
1 kolo 
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-2-1" class="collapse" data-parent="#accordion-1-2" aria-labelledby="heading-1-2-1">
                        <
div class="card-body">
                          
Text 1 &gt&gt1
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-1-2-2">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-2-2" aria-expanded="false" aria-controls="collapse-1-2-2">
                           
2 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-2-2" class="collapse" data-parent="#accordion-1-2" aria-labelledby="heading-1-2-2">
                        <
div class="card-body">
                          
Text 1 &gt&gt2  sss
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-1-2-3">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-2-3" aria-expanded="false" aria-controls="collapse-1-2-3">
                           
3 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-2-3" class="collapse" data-parent="#accordion-1-2" aria-labelledby="heading-1-2-3">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                       <
div class="card">
                      <
div class="card-header" id="heading-1-2-4">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-1-2-4" aria-expanded="false" aria-controls="collapse-1-2-4">
                           
Kompletní služba 4 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-1-2-4" class="collapse" data-parent="#accordion-1-2" aria-labelledby="heading-1-2-4">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                  </
div>

              </
div>
            </
div>
          </
div>
        </
div>      
      
      </
div>
    </
div>
  </
div>
  
  
  
  <
div class="card">
    <
div class="card-header" id="heading-2">
      <
h5 class="mb-0">
        <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2" aria-expanded="false" aria-controls="collapse-2">
         
Od R18   
        
</a>
      </
h5>
    </
div>
    <
div id="collapse-2" class="collapse" data-parent="#accordion-2" aria-labelledby="heading-2" style="">
      <
div class="card-body">
        
        <
div id="accordion-2">
          <
div class="card">
            <
div class="card-header" id="heading-2-1">
              <
h5 class="mb-0">
                <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-1" aria-expanded="false" aria-controls="collapse-2-1">
                 
Pneumatiky zakoupím u vás
                
</a>
              </
h5>
            </
div>
            <
div id="collapse-2-1" class="collapse" data-parent="#accordion-2" aria-labelledby="heading-2-1">
              <
div class="card-body">

                  <
div id="accordion-2-1">
                    <
div class="card">
                      <
div class="card-header" id="heading-2-1-1">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-1-1" aria-expanded="false" aria-controls="collapse-2-1-1">
                           
1 kolo  
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-1-1" class="collapse" data-parent="#accordion-2-1" aria-labelledby="heading-2-1-1">
                        <
div class="card-body">
                          
Text 1 &gt&gt1
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-2-1-2">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-1-2" aria-expanded="false" aria-controls="collapse-2-1-2">
                           
2 kola    
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-1-2" class="collapse" data-parent="#accordion-2-1" aria-labelledby="heading-2-1-2">
                        <
div class="card-body">
                          
Text 1 &gt&gt2
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-2-1-3">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-1-3" aria-expanded="false" aria-controls="collapse-2-1-3">
                           
3 kola    
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-1-3" class="collapse" data-parent="#accordion-2-1" aria-labelledby="heading-2-1-3">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                       <
div class="card">
                      <
div class="card-header" id="heading-2-1-4">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-1-4" aria-expanded="false" aria-controls="collapse-2-1-4">
                           
Kompletní služba 4 kola   
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-1-4" class="collapse" data-parent="#accordion-2-1" aria-labelledby="heading-2-1-4">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                  </
div>

              </
div>
            </
div>
          </
div>
          <
div class="card">
            <
div class="card-header" id="heading-2-2">
              <
h5 class="mb-0">
                <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-2" aria-expanded="false" aria-controls="collapse-2-2">
                  
Pneumatiky mám vlastní
                
</a>
              </
h5>
            </
div>
           <
div id="collapse-2-2" class="collapse" data-parent="#accordion-2" aria-labelledby="heading-2-2">
              <
div class="card-body">

                  <
div id="accordion-2-2">
                    <
div class="card">
                      <
div class="card-header" id="heading-2-2-1">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-2-1" aria-expanded="false" aria-controls="collapse-2-2-1">
                           
1 kolo 
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-2-1" class="collapse" data-parent="#accordion-2-2" aria-labelledby="heading-2-2-1">
                        <
div class="card-body">
                          
Text 1 &gt&gt1
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-1-2-2">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-2-2" aria-expanded="false" aria-controls="collapse-2-2-2">
                           
2 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-2-2" class="collapse" data-parent="#accordion-2-2" aria-labelledby="heading-2-2-2">
                        <
div class="card-body">
                          
Text 1 &gt&gt2  sss
                        
</div>
                      </
div>
                    </
div>
                    <
div class="card">
                      <
div class="card-header" id="heading-2-2-3">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-2-3" aria-expanded="false" aria-controls="collapse-2-2-3">
                           
3 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-2-3" class="collapse" data-parent="#accordion-2-2" aria-labelledby="heading-2-2-3">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                       <
div class="card">
                      <
div class="card-header" id="heading-2-2-4">
                        <
h5 class="mb-0">
                          <
class="collapsed" role="button" data-toggle="collapse" href="#collapse-2-2-4" aria-expanded="false" aria-controls="collapse-2-2-4">
                           
Kompletní služba 4 kola
                          
</a>
                        </
h5>
                      </
div>
                      <
div id="collapse-2-2-4" class="collapse" data-parent="#accordion-2-2" aria-labelledby="heading-2-2-4">
                        <
div class="card-body">
                          
Text 1 &gt&gt3
                        
</div>
                      </
div>
                    </
div>
                  </
div>

              </
div>
            </
div>
          </
div>
        </
div>  
        
        
        
      </
div>
    </
div>
  </
div>  
</
div
Neměl by někdo chvilku zkouknout kód a případně poradit?

Moc děkuju



----

Co se právě děje na Webtrhu?

11.06.2020 13:58
2
Ahoj,
na řádku 176 máš
Kód:
data-parent="#accordion-2"
má tam být
Kód:
data-parent="#accordion"