简体   繁体   中英

typo3 bootstrap accordion - collapse the initial element

This is related to Typo3 with the bootstrap theme only please.

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

<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.

Any guidance welcome.

Here try this

So basically you get element by its Id and re-set its class attribute without the '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

# 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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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