2017-05-08 42 views
2

我正在使用jQuerySteps插件來創建制表符。我有四個部分,因此4個標籤,他們工作很好。但我希望每個選項卡都有different percent of width。截至目前,他們每個人獲得25%。但我想手動爲它們分配寬度。我可以通過添加CSS類來實現。但由於它是一個插件,我無法找到<ul> and <li>如何創建和渲染。如何更改jQuery步驟插件中的製表符寬度

下面是插件如何設置25%的寬度。 enter image description here

我的前端代碼:

<div id="example-basic"> 
    <h3>Keyboard</h3> 
    <section> 
     <p>Try the keyboard navigation by clicking arrow left or right!</p> 
    </section> 
    <h3>Effects</h3> 
    <section> 
     <p>Wonderful transition effects.</p> 
    </section> 
    <h3>Pager</h3> 
    <section> 
     <p>The next and previous buttons help you to navigate through your content.</p> 
    </section> 
</div> 

JS代碼

$("#example-basic").steps({ 
    headerTag: "h3", 
    bodyTag: "section", 
    transitionEffect: "slideLeft", 
    autoFocus: true 
}); 

問:

如何添加ID或類,這樣我可以設置寬度first tab : 20 % second tab:40 % and so on

+0

你也可以使用像.wizard> .steps> ul>李:第n個孩子(1),.嚮導> .steps> ul>李:第n個孩子(2) –

+0

有效。你可以添加它作爲答案。我會接受它。它也會幫助其他人。 – Unbreakable

+0

Plz發小提琴,所以我可以在這裏設置 –

回答

1

CSS

.wizard>.steps>ul>li:nth-child(1){ 
    width: 20%; 
} 
.wizard>.steps>ul>li:nth-child(2){ 
    width: 40%; 
} 
相關問題