溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

使用JavaScript怎么實現(xiàn)一個帶箭頭的進(jìn)度流程

發(fā)布時間:2021-04-16 16:31:00 來源:億速云 閱讀:162 作者:Leah 欄目:web開發(fā)

這篇文章給大家介紹使用JavaScript怎么實現(xiàn)一個帶箭頭的進(jìn)度流程,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。

html

<ul class="cssNav">
  <li v-for="(item,i) in list" :class="[num==i?'active':'']" @click="tab(i)">{{item}}</li>
</ul>

css

.cssNav {
    margin: 100px auto;
    background-color: #dedede;
    width:420px;
  }

  .cssNav li{
    padding:0 20px;
    line-height: 40px;
    background-color: #50abe4;
    display: inline-block;
    color:#fff;
    position: relative;
    margin-right: 4px;
  }
  .cssNav li:after{
    content:"";
    display: block;
    border-top:20px solid transparent;
    border-bottom:20px solid transparent;
    border-left:20px solid #50abe4;
    position: absolute;
    right:-20px;
    top:0;
    z-index: 10;
  }
  .cssNav li:before{
    content:"";
    display: block;
    border-top:20px solid transparent;
    border-bottom:20px solid transparent;
    border-left:20px solid #fff;
    position: absolute;
    left:0px;
    top:0;
  }

  .cssNav li:first-child{
    border-radius: 4px 0 0 4px;
    padding-left:25px;
  }
  .cssNav li:last-child,.cssNavEnd{
    border-radius: 0 4px 4px 0;
    padding-right: 25px;
  }
  .cssNav li:first-child:before{
    display: none;
  }
  .cssNav li:last-child:after,.cssNavEnd:after{
    display: none;
  }
  .cssNav li.active { 
    background-color: #ef72b6; 
  } 
  .cssNav li.active:after { 
    border-left-color: #ef72b6; 
  }

js

// 需要引入vue.js 
 new Vue({
    el: '.cssNav',
    data: {
        num:0,
        list:['首頁','測試文字','新聞也','地址頁']
      },
    methods: {
      tab:function(i){
        this.num = i;
      }
    }  
  })

關(guān)于使用JavaScript怎么實現(xiàn)一個帶箭頭的進(jìn)度流程就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI