parent
ac1b32b88b
commit
ee2cecd675
@ -1,22 +1,18 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#bing").load("https://raw.githubusercontent.com/meisnate12/PMM-Image-Sets/master/movies/readme.md");
|
$("#bing").load("https://raw.githubusercontent.com/meisnate12/PMM-Image-Sets/master/movies/readme.md", function () {
|
||||||
var acc = document.getElementsByClassName("image-accordion");
|
$(".image-accordion").click(function () {
|
||||||
var i;
|
this.classList.toggle("image-active");
|
||||||
|
var parent = this.parentElement;
|
||||||
for (i = 0; i < acc.length; i++) {
|
var panel = this.nextElementSibling;
|
||||||
acc[i].addEventListener("click", function() {
|
if (panel.style.maxHeight) {
|
||||||
this.classList.toggle("image-active");
|
panel.style.maxHeight = null;
|
||||||
var parent = this.parentElement;
|
} else {
|
||||||
var panel = this.nextElementSibling;
|
panel.style.maxHeight = panel.scrollHeight + "px";
|
||||||
if (panel.style.maxHeight){
|
parent.style.maxHeight = parseInt(parent.style.maxHeight) + panel.scrollHeight + "px";
|
||||||
panel.style.maxHeight = null;
|
}
|
||||||
} else {
|
});
|
||||||
panel.style.maxHeight = panel.scrollHeight + "px";
|
});
|
||||||
parent.style.maxHeight = parseInt(parent.style.maxHeight) + panel.scrollHeight + "px";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in new issue