- 當我點擊第2節第2節內容打開。過渡css屬性使內容看到兩次
- 當我點擊第2節內容回來它關閉,但是當它關閉我看到文本兩次。
- 當第2節機構即將關閉我看到第2節內容在黑色但綠色背景消失
- 我調試了代碼,我認爲它的發生是由於過渡css屬性,我無法刪除它,因爲我需要看到順利的關閉。
transition:height .5s; transition:height .5s,padding-top .5s,padding-bottom .5s;
- 你能告訴我如何解決它。
- 在小提琴中提供我的代碼。
.accordion-section {
border-bottom: solid 1px #000;
}
.accordion-section > h3 {
padding: 6px;
font-size: 16px;
background-color: #CCC;
margin: 0;
}
.accordion-section > .body {
height: 0;
padding: 0 10px;
overflow-y: hidden;
transition: height .5s;
transition: height .5s, padding-top .5s, padding-bottom .5s;
}
下面的答案有幫助嗎? –
@AlanDunning感謝您的回覆......我現在添加了圖片...綠色背景消失後仍然看到第1部分內容文字...我想讓它消失在同一時間綠色背景消失 –