在custom liquid里创建了tab,想要引用custom_form的sections,该怎么写引用section或page页面的代码?
使用了chatgpt修改了多次都报错。现在的代码:
<style>
/* Tabs container */
.tabs {
display: flex;
justify-content: space-evenly;
border-bottom: 1px solid #e1e1e1;
padding-bottom: 10px;
margin-bottom: 20px;
}
/* Individual tab */
.tab {
font-size: 16px;
font-weight: 600;
color: #333;
cursor: pointer;
position: relative;
padding-bottom: 5px;
text-transform: uppercase;
}
/* Active tab */
.tab.active {
color: #000;
}
/* Active tab indicator */
.tab.active::after {
content: “”;
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 2px;
background-color: #000;
}
/* Tab content container */
.tab-content {
line-height: 1.5;
font-size: 16px;
width: 60%;
margin: 0 auto;
}
/* Active tab content */
.tab-content.active {
display: block;
}
.tab-content > p {
padding-left: 20px;
}
@media (max-width: 767px) {
.tab-content {
width: 100%;
padding: 0 20px;
}
}
@media (max-width: 767px) {
.tab-content img {
max-width: 100%;
height: auto;
}
}
</style>
<div class=”tabs”>
<div class=”tab” id=”tab1″ onclick=”switchTab(event, ‘description’)”>
Description
</div>
<div class=”tab” id=”tab2″ onclick=”switchTab(event, ‘ask-question’)”>
Ask a Question
</div>
</div>
<div id=”description” class=”tab-content active”>
<p>{{ product.description }}</p>
</div>
<div id=”ask-question” class=”tab-content”>
{{pages[settings.contact].content}}
</div>
</div>
<script>
document.addEventListener(“DOMContentLoaded”, function () {
document.getElementById(“tab1”).click();
});
function switchTab(evt, tabName) {
let tabcontent, tablinks;
tabcontent = document.getElementsByClassName(“tab-content”);
for (let i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = “none”;
}
tablinks = document.getElementsByClassName(“tab”);
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(” active”, “”);
}
document.getElementById(tabName).style.display = “block”;
evt.currentTarget.className += ” active”;
}
</script>