简体   繁体   English

typo3 bootstrap手风琴-折叠初始元素

[英]typo3 bootstrap accordion - collapse the initial element

This is related to Typo3 with the bootstrap theme only please. 请仅与带有bootstrap主题的Typo3有关。

I'd like to have ALL elements of the accordion closed at page startup. 我想在页面启动时关闭手风琴的所有元素。 Currently the top element is open like here 目前,顶部元素已打开,如下所示

In do understand that it's only related to the in in the class of this statement 确实要了解,它仅与此语句的class in in有关

<div id="panel-425-0" class="panel-collapse collapse in"> 

but changing this in the source would have side effects to other locations which I'like to avoid. 但是在源代码中更改此设置会对我要避免的其他位置产生副作用。

So I'm looking for a solution to do the closure with CSS or javascript. 因此,我正在寻找一种使用CSS或javascript进行封闭的解决方案。

Any guidance welcome. 欢迎任何指导。

Here try this 在这里试试

So basically you get element by its Id and re-set its class attribute without the 'in' class. 因此,基本上,您可以通过其ID来获取元素,并在不使用“ in”类的情况下重置其class属性。

<script>
    document.getElementById('panel-425-0').setAttribute('class','panel-collapse collapse');
</script>

Just for completenes, my own reminder and to whom it might help the full TS to be put into the setup section of a template 只是为了完整起见,我自己的提醒以及它可能帮助谁将完整的TS放入模板的设置部分

# get some javascript into 
# for hiding the first accordion element

page.jsFooterInline.20 = TEXT
page.jsFooterInline.20.value = document.getElementById('accordion-....').setAttribute('class','panel-collapse collapse');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM