Hi once more!
Using 1.2.4 and moodle 3.2 I run into a problem:
I want to add an accordion (pure css) into some Marketing Blocks on frontpage.
When editing the code in Marketing block edit page (using Atto) all runs fine -accordion works- but when saving it and testing on frontpage, nothing works! So the attribute --id='item1'-- from the html code is not appearing on frontpage when inspecting that on frontpage.
Is that an issue of Atto? What may I have to set/unset to get that work?
Code has two parts. one is css (I set that in my custom-css) and the other part is html, as I set it in the respective marketing block.
I really think I have simple code with no difficult settings. I need that to work.
---I have marketing blocks with "Coventry-Style". I also tried "no Style" - same result!---
Please put me on track!
Thank you
Rolf
CSS ****************
/* styling for ACCORDION START */
.accordion {
border: 1px solid white;
padding: 0 10px;
margin: 0 auto;
list-style: none outside;
}
.accordion > * + * { border-top: 1px solid white; }
.accordion-item-hd {
display: block;
padding: 15px 30px 15px 0;
position: relative;
cursor: pointer;
font-size: 18px;
font-weight: bold;
}
.accordion-item-input:checked ~ .accordion-item-bd {
max-height: 1000px;
padding-top: 15px;
margin-bottom: 15px;
-webkit-transition: max-height 1s ease-in, margin .3s ease-in, padding .3s ease-in;
transition: max-height 1s ease-in, margin .3s ease-in, padding .3s ease-in;
}
.accordion-item-input:checked ~ .accordion-item-hd > .accordion-item-hd-cta {
-webkit-transform: rotate(0);
-ms-transform: rotate(0);
transform: rotate(0);
}
.accordion-item-hd-cta {
display: block;
width: 30px;
position: absolute;
top: calc(50% - 6px );
right: 0;
pointer-events: none;
-webkit-transition: -webkit-transform .3s ease;
transition: transform .3s ease;
-webkit-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
transform: rotate(-180deg);
text-align: center;
font-size: 12px;
line-height: 1;
}
.accordion-item-bd {
max-height: 0;
margin-bottom: 0;
overflow: hidden;
-webkit-transition: max-height .15s ease-out, margin-bottom .3s ease-out, padding .3s ease-out;
transition: max-height .15s ease-out, margin-bottom .3s ease-out, padding .3s ease-out;
}
.accordion-item-input {
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1;
overflow: hidden;
position: absolute;
left: -9999px;
}
/* styling for ACCORDION END */
****************
HTML **************** (I tried it with other character than ▲ without success )
<ul class="accordion css-accordion">
<li class="accordion-item">
<input class="accordion-item-input" type="checkbox" name="accordion" id="item1">
<label for="item1" class="accordion-item-hd">Accordion Heading 1<span class="accordion-item-hd-cta">▲</span></label>
<div class="accordion-item-bd">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex consequuntur architecto maxime.
</div>
</li>
</ul>
****************