联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
TAB切换,但后面的“更多”公用,如何判断这个更多是哪个TAB呢
类型:迅睿CMS 更新时间:2021-12-27 14:37:05

TAB切换,但后面的“更多”公用,如何判断这个更多是哪个TAB呢?

imageimage

<nav>

  <div class="nav nav-tabs" role="tablist">

    <button class="nav-link fs-5 fw-bold active" id="nav-news-one" data-bs-toggle="tab" data-bs-target="#news-one" type="button" role="tab" aria-controls="nav-home" aria-selected="true">{category module=share id=20}{$t.name}{/category}</button>

    <button class="nav-link fs-5 fw-bold" id="nav-news-two" data-bs-toggle="tab" data-bs-target="#news-two" type="button" role="tab" aria-controls="nav-profile" aria-selected="false">{category module=share id=22}{$t.name}{/category}</button>

 

<a class="text-muted ms-auto" href="{$t['url']}"><i class="bi bi-three-dots fs-3"></i></a>


  </div>

</nav>



回帖
  • 云南麦田
    #1楼    云南麦田
    2021-12-26 11:22:52
    iPhone手机 0
    这个属于前端解决
  • 逆水行舟
    #2楼    逆水行舟
    2021-12-26 11:57:22
    华为手机 0
    这种情况,一般你那个更多是跟tab一起切换的。第二种方法,切换的时候js变那个更多的栏目ID值。
  • 小风
    #3楼    小风
    2021-12-26 12:23:57
    Chrome 0
    <span class="more"><a href="" target="_blank" style="display: inline;">更多&gt;&gt;</a> <a href="" target="_blank" style="display: none;">更多&gt;&gt;</a> </span><script type="text/javascript">jQuery(".slideTxtBox").slide({ mainCell:".bd", targetCell:".more a", effect:"fold"});</script>
  • 李白怕喝酒
    #4楼    李白怕喝酒
    2021-12-26 12:29:40
    Chrome 0
    小风 你这段代码应该能解决,但是如何运用到我这个页面呢,可以帮写一下具体代码吗?非常感谢
  • 李白怕喝酒
    #5楼    李白怕喝酒
    2021-12-26 12:35:53
    Chrome 0
    能不能用IF判断,不是A就是B呢,我写了但是如何和上面关联呢,视乎有问题 {if $key==0} {category module=share id=20} <a class="text-muted ms-auto" href="{$t['url']}"><i class="bi bi-three-dots fs-3"></i></a> {/category} {else} {category module=share id=22} <a class="text-muted ms-auto" href="{$t['url']}"><i class="bi bi-three-dots fs-3"></i></a> {/category} {/if}
  • 悦笙
    #6楼    悦笙
    2021-12-26 12:42:33
    小米手机 0
    点击按钮时,再用js给更多这个链接赋值
  • 李白怕喝酒
    #7楼    李白怕喝酒
    2021-12-26 12:45:35
    Chrome 0
    悦笙 兄台可否帮忙具体写一下,小可不才写不了,非常感谢
  • 悦笙
    #8楼    悦笙
    2021-12-26 12:53:33
    Firefox 95.0 0
    <nav>
      <div class="nav nav-tabs" role="tablist">
        {category module=share id=20}
        <button class="nav-link fs-5 fw-bold active" id="nav-news-one" data-bs-toggle="tab" data-bs-target="#news-one" type="button" role="tab" aria-controls="nav-home" aria-selected="true" data-url="{$t.url}">{$t.name}</button>
        {/category}
        {category module=share id=22}
        <button class="nav-link fs-5 fw-bold" id="nav-news-two" data-bs-toggle="tab" data-bs-target="#news-two" type="button" role="tab" aria-controls="nav-profile" aria-selected="false" data-url="{$t.url}">{$t.name}</button>
        {/category} 
        <a class="text-muted ms-auto" href=" {category module=share id=20}{$t['url']}{/category}"><i class="bi bi-three-dots fs-3"></i></a>
      </div>
    </nav>
    <script>
      $(function(){
        $('.nav-tabs').on('click', function(){
          $('.text-muted.ms-auto').src('href', $(this).data('.url'))
          
        })
      })
    </script>
  • 悦笙
    #9楼    悦笙
    2021-12-26 12:55:19
    Firefox 95.0 0
    <nav>
      <div class="nav nav-tabs" role="tablist">
        {category module=share id=20}
        <button class="nav-link fs-5 fw-bold active" id="nav-news-one" data-bs-toggle="tab" data-bs-target="#news-one" type="button" role="tab" aria-controls="nav-home" aria-selected="true" data-url="{$t.url}">{$t.name}</button>
        {/category}
        {category module=share id=22}
        <button class="nav-link fs-5 fw-bold" id="nav-news-two" data-bs-toggle="tab" data-bs-target="#news-two" type="button" role="tab" aria-controls="nav-profile" aria-selected="false" data-url="{$t.url}">{$t.name}</button>
        {/category} 
        <a class="text-muted ms-auto" href=" {category module=share id=20}{$t['url']}{/category}"><i class="bi bi-three-dots fs-3"></i></a>
      </div>
    </nav>
    <script>
      $(function(){
        $('.nav-tabs button').on('click', function(){
          $('.text-muted.ms-auto').src('href', $(this).data('.url'))
          
        })
      })
    </script>
  • 悦笙
    #10楼    悦笙
    2021-12-26 12:57:49
    Firefox 95.0 0
    上面还是写错
    <nav>
      <div class="nav nav-tabs" role="tablist">
        {category module=share id=20}
        <button class="nav-link fs-5 fw-bold active" id="nav-news-one" data-bs-toggle="tab" data-bs-target="#news-one" type="button" role="tab" aria-controls="nav-home" aria-selected="true" data-url="{$t.url}">{$t.name}</button>
        {/category}
        {category module=share id=22}
        <button class="nav-link fs-5 fw-bold" id="nav-news-two" data-bs-toggle="tab" data-bs-target="#news-two" type="button" role="tab" aria-controls="nav-profile" aria-selected="false" data-url="{$t.url}">{$t.name}</button>
        {/category} 
        <a class="text-muted ms-auto" href=" {category module=share id=20}{$t['url']}{/category}"><i class="bi bi-three-dots fs-3"></i></a>
      </div>
    </nav>
    <script>
      $(function(){
        $('.nav-tabs button').on('click', function(){
          $('.text-muted.ms-auto').attr('href', $(this).data('.url'))
          
        })
      })
    </script>

  • 悦笙
    #11楼    悦笙
    2021-12-26 13:00:31
    Firefox 95.0 0
    <nav>
      <div class="nav nav-tabs" role="tablist">
        {category module=share id=20}
        <button class="nav-link fs-5 fw-bold active" id="nav-news-one" data-bs-toggle="tab" data-bs-target="#news-one" type="button" role="tab" aria-controls="nav-home" aria-selected="true" data-url="{$t.url}">{$t.name}</button>
        {/category}
        {category module=share id=22}
        <button class="nav-link fs-5 fw-bold" id="nav-news-two" data-bs-toggle="tab" data-bs-target="#news-two" type="button" role="tab" aria-controls="nav-profile" aria-selected="false" data-url="{$t.url}">{$t.name}</button>
        {/category} 
        <a class="text-muted ms-auto" href=" {category module=share id=20}{$t['url']}{/category}"><i class="bi bi-three-dots fs-3"></i></a>
      </div>
    </nav>
    <script>
      $(function(){
        $('.nav-tabs button').on('click', function(){
          $('.text-muted.ms-auto').attr('href', $(this).data('url'))
          
        })
      })
    </script>
    满意答案
  • 李白怕喝酒
    #12楼    李白怕喝酒
    2021-12-27 14:37:05
    Chrome 0
    @悦笙:很热心,真的很棒