第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

選項(xiàng)卡切換無法在多張卡片上正常工作

選項(xiàng)卡切換無法在多張卡片上正常工作

我正在創(chuàng)建一個應(yīng)用程序,它生成多張卡片,每張卡片上有 3 個選項(xiàng)卡。但是選項(xiàng)卡切換并不像預(yù)期的那樣工作。在第一張卡上執(zhí)行此操作時,它工作正常,但是當(dāng)我嘗試按其他卡選項(xiàng)卡時,它只會在第一張卡上切換。我無法理解它。$(document).on('click', '.navigation a', function(e) {  e.preventDefault();  $(this).tab('show');})<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" /><script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script><div class="card-columns">  <div class="card">    <div class="card-header">      <ul class="nav nav-tabs card-header-tabs navigation" role="tablist">        <li class="nav-item">          <a class="nav-link active" href=".info" role="tab" aria-controls="info" aria-selected="true" data-toggle="tab">Info</a>        </li>        <li class="nav-item">          <a class="nav-link" href=".ingredients" role="tab" aria-controls="ingredients" aria-selected="false" data-toggle="tab">Ingredients</a>        </li>        <li class="nav-item">          <a class="nav-link" href=".nutrition" role="tab" aria-controls="nutrition" aria-selected="false" data-toggle="tab">Nutrition information</a>        </li>      </ul>    </div>    <div class="card-body">      <h4 class="card-title">Item name</h4>      <div class="tab-content mt-3">        <div class="tab-pane active info" role="tabpanel">          <img src="https://images.pexels.com/photos/1279330/pexels-photo-1279330.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260" class="card-img-top" alt="">          <div class="text-center">            <a href="" target=_blank><button type="button" class="btn btn-primary">Full recipe</button></a>            <a href=""><button type="button" class="btn btn-primary">Add to favorites</button></a>          </div>        </div>
查看完整描述

1 回答

?
小唯快跑啊

TA貢獻(xiàn)1863條經(jīng)驗(yàn) 獲得超2個贊

這是因?yàn)槭褂昧祟惡?href,例如試試這個:


$(document).on('click','.navigation a', function (e) {

    e.preventDefault();

    $(this).tab('show');

})

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>

<div class="card-columns">

  <div class="card">

    <div class="card-header">

      <ul class="nav nav-tabs card-header-tabs navigation" role="tablist">

        <li class="nav-item">

          <a class="nav-link active" href=".info" role="tab" aria-controls="info" aria-selected="true" data-toggle="tab">Info</a>

        </li>

        <li class="nav-item">

          <a class="nav-link"  href=".ingredients" role="tab" aria-controls="ingredients" aria-selected="false" data-toggle="tab">Ingredients</a>

        </li>

        <li class="nav-item">

          <a class="nav-link" href=".nutrition" role="tab" aria-controls="nutrition" aria-selected="false" data-toggle="tab">Nutrition information</a>

        </li>

      </ul>

    </div>

    

    <div class="card-body">

      <h4 class="card-title">Item name</h4>

      <div class="tab-content mt-3">

        <div class="tab-pane active info" role="tabpanel">

          <img src="https://images.pexels.com/photos/1279330/pexels-photo-1279330.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260" class="card-img-top" alt="">

          <div class="text-center">

            <a href="" target=_blank><button type="button" class="btn btn-primary">Full recipe</button></a>

            <a href=""><button type="button" class="btn btn-primary">Add to favorites</button></a>

          </div>

        </div>


        <div class="tab-pane ingredients" role="tabpanel" aria-labelledby="ingredients-tab">

          <h6 class="card-subtitle mb-2">Ingredient list</h6>

          <ul id=ingredientList>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

          </ul>

        </div>


        <div class="tab-pane nutrition" role="tabpanel" aria-labelledby="nutrition-tab">

          <h6 class="card-subtitle mb-2">Nutrition information</h6>

          <ul id=nutritionInfo>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

          </ul>

        </div>

      </div>

    </div>

  </div>

  

  <div class="card">

    <div class="card-header">

      <ul class="nav nav-tabs card-header-tabs navigation" role="tablist">

        <li class="nav-item">

          <a class="nav-link active" href=".info2" role="tab" aria-controls="info" aria-selected="true" data-toggle="tab">Info</a>

        </li>

        <li class="nav-item">

          <a class="nav-link"  href=".ingredients2" role="tab" aria-controls="ingredients" aria-selected="false" data-toggle="tab">Ingredients</a>

        </li>

        <li class="nav-item">

          <a class="nav-link" href=".nutrition2" role="tab" aria-controls="nutrition" aria-selected="false" data-toggle="tab">Nutrition information</a>

        </li>

      </ul>

    </div>

    

    <div class="card-body">

      <h4 class="card-title">Item name</h4>

      <div class="tab-content mt-3">

        <div class="tab-pane active info2" role="tabpanel">

          <img src="https://images.pexels.com/photos/1279330/pexels-photo-1279330.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260" class="card-img-top" alt="">

          <div class="text-center">

            <a href="" target=_blank><button type="button" class="btn btn-primary">Full recipe</button></a>

            <a href=""><button type="button" class="btn btn-primary">Add to favorites</button></a>

          </div>

        </div>


        <div class="tab-pane ingredients2" role="tabpanel" aria-labelledby="ingredients-tab">

          <h6 class="card-subtitle mb-2">Ingredient list</h6>

          <ul id=ingredientList>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

          </ul>

        </div>


        <div class="tab-pane nutrition2" role="tabpanel" aria-labelledby="nutrition-tab">

          <h6 class="card-subtitle mb-2">Nutrition information</h6>

          <ul id=nutritionInfo>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

          </ul>

        </div>

      </div>

    </div>

  </div>

  

  <div class="card">

    <div class="card-header">

      <ul class="nav nav-tabs card-header-tabs navigation" role="tablist">

        <li class="nav-item">

          <a class="nav-link active" href=".info3" role="tab" aria-controls="info" aria-selected="true" data-toggle="tab">Info</a>

        </li>

        <li class="nav-item">

          <a class="nav-link"  href=".ingredients3" role="tab" aria-controls="ingredients" aria-selected="false" data-toggle="tab">Ingredients</a>

        </li>

        <li class="nav-item">

          <a class="nav-link" href=".nutrition3" role="tab" aria-controls="nutrition" aria-selected="false" data-toggle="tab">Nutrition information</a>

        </li>

      </ul>

    </div>

    

    <div class="card-body">

      <h4 class="card-title">Item name</h4>

      <div class="tab-content mt-3">

        <div class="tab-pane active info3" role="tabpanel">

          <img src="https://images.pexels.com/photos/1279330/pexels-photo-1279330.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260" class="card-img-top" alt="">

          <div class="text-center">

            <a href="" target=_blank><button type="button" class="btn btn-primary">Full recipe</button></a>

            <a href=""><button type="button" class="btn btn-primary">Add to favorites</button></a>

          </div>

        </div>


        <div class="tab-pane ingredients3" role="tabpanel" aria-labelledby="ingredients-tab">

          <h6 class="card-subtitle mb-2">Ingredient list</h6>

          <ul id=ingredientList>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

            <li>Ingredient</li>

          </ul>

        </div>


        <div class="tab-pane nutrition3" role="tabpanel" aria-labelledby="nutrition-tab">

          <h6 class="card-subtitle mb-2">Nutrition information</h6>

          <ul id=nutritionInfo>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

            <li>Nutrition item</li>

          </ul>

        </div>

      </div>

    </div>

  </div>

  </div>


查看完整回答
反對 回復(fù) 2023-04-27
  • 1 回答
  • 0 關(guān)注
  • 134 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號