新增手風琴樣式widget

This commit is contained in:
邱博亞 2023-10-16 21:41:26 +08:00
parent 6109b1735a
commit 96fddd87db
2 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,30 @@
<div class="widget-faqs widget2">
<h3 class="widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="list-unstyled" data-list="faqs" data-level="0">
<li class="widget-content">
<h4 class="widget-content-title-wrap">
<span class="widget-content-title">{{title}}</span>
<span data-list="statuses" data-level="1">
<span class="label status {{status-class}}">{{status}}</span>
</span>
</h4>
<section class="post">
<p>{{answer}}</p>
<div data-list="qa_files" data-level="1"><div><a href="{{file_url}}" target="_blank">{{file_title}}</a></div></div>
</section>
</li>
</ul>
</div>
<script>
$('.widget-faqs.widget2[data-subpart-id="{{subpart-id}}"] .widget-content .widget-content-title-wrap').click(function(){
$('section.post').slideUp(200);
$(this).removeClass('open');
if($("+section",this).css("display")=="none"){
$("+section",this).slideDown(300);
$(this).addClass("open");
}
})
</script>

View File

@ -12,8 +12,8 @@
"filename" : "faq_index2",
"force_cover": "true",
"name" : {
"zh_tw" : "2. 手風琴列表 ( 模組標題, 問題 )",
"en" : "2. Accordion list ( widget-title, question )"
"zh_tw" : "2. 手風琴列表 ( 模組標題, 問題, 答案 )",
"en" : "2. Accordion list ( widget-title, question, answer )"
},
"thumbnail" : "thumb.png"
}
@ -26,6 +26,15 @@
"en" : "1. List (widget-title, question)"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "faq_widget2",
"name" : {
"zh_tw" : "2. 手風琴列表 ( 模組標題, 問題, 答案 )",
"en" : "2. Accordion list ( widget-title, question, answer )"
},
"thumbnail" : "thumb.png"
}
]
}