我正在尝试使用以下代码创建手风琴。如果将以下标签放在一起,则其工作正常。我想在页面其他部分的某个标签内插入元素
<dt>
<li class="nav-item" id='l1' >
<a class="nav-link active js-accordionTrigger" href="#accordion1" aria-expanded="false" aria-
controls="accordion1">
<i class="material-icons">camera</i>
Studio
</a>
</li></dt>
<dd class="accordion-content accordionItem is-collapsed" id="accordion1" aria-hidden="true">
<p>Lorem ipsum doplacerat. Cras justo purus,enim sit amet varius. Pellentesque justo dui,
sodales quis luctus a, iaculis eget mauris.</p>
</dd>
如果我尝试在这里放置标签。它不起作用,我可以看到错误 setAttribute undefined
<div class="tab-content tab-space">
<div class="tab-pane active text-center gallery" >
<dd class="accordion-content accordionItem is-collapsed" id="accordion1" aria-hidden="true">
<p>Lorem iet mauris.</p>
</dd>
</div>
</div>
这是Javascript和Jquery代码
<script>
$(document).ready(function () {
var d = document,
$accordionToggles = $('.js-accordionTrigger'),
touchSupported = ('ontouchstart' in window),
pointerSupported = ('pointerdown' in window),
skipClickDelay = function (e) {
e.preventDefault();
e.target.click();
},
setAriaAttr = function (el, ariaType, newProperty) {
el[0].setAttribute(ariaType, newProperty);
},
setAccordionAria = function (el1, el2, expanded) {
setAriaAttr(el1, 'aria-expanded', expanded ? true : false);
setAriaAttr(el2, 'aria-expanded', expanded ? false : true);
},
素胚勾勒不出你