Skip to content

Instantly share code, notes, and snippets.

@actual-saurabh
Last active March 25, 2022 09:55
Show Gist options
  • Select an option

  • Save actual-saurabh/01477e2e4db5f8915c6ed4902df5d566 to your computer and use it in GitHub Desktop.

Select an option

Save actual-saurabh/01477e2e4db5f8915c6ed4902df5d566 to your computer and use it in GitHub Desktop.
LifterLMS Collapsible Course Syllabus
.llms-syllabus-wrapper .llms-section-title {
cursor: pointer;
}
.llms-syllabus-wrapper .llms-section-title::after {
content: "\25b6";
float: left;
display: inline-block;
width: 15px;
text-align: left;
margin-right: 15px;
}
.llms-syllabus-wrapper .llms-section-title.llms-syllabus-expanded::after {
content: "\25bc";
}
jQuery('.llms-syllabus-wrapper').find('h3.llms-section-title').each(function(){
var llms_lessons = jQuery(this).nextUntil('h3.llms-section-title');
llms_lessons.hide(); // this line will automatically collapse the sections on page load
jQuery(this).on('click', function(){
llms_lessons.slideToggle();
jQuery(this).toggleClass("llms-syllabus-expanded");
});
});
@Anshu-wwc
Copy link

Thanks, It helped and works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment