Skip to content

Instantly share code, notes, and snippets.

@jamiejohnsonkc
Created June 4, 2019 20:31
Show Gist options
  • Save jamiejohnsonkc/75d78fab92abc8bbffbe451fb7aed7c1 to your computer and use it in GitHub Desktop.
Save jamiejohnsonkc/75d78fab92abc8bbffbe451fb7aed7c1 to your computer and use it in GitHub Desktop.
readmore/readless #accordian #button #effect
.container__accordian{
display: none;
}
<a href="#mo-solutions" class="ui-button__expand ui-button__expand--black-white mo__expand-button" id="expand-mo-solutions" title="read more"><?php get_template_part('buttons/button', 'expand'); ?></a>
<div class="container__accordion mo__accordian" id="mo-solutions">
<div class="mo__diagram-copy">I begin every project with four simple words &mdash;what is your objective.It doesn't matter if it's stunning or cutting-edge if it doesn't solve your problem.</div>
</div>
jQuery(document).ready(function($) {
$('#expand-mo-solutions').click(function(e) {
e.preventDefault();
var id = $(this).attr('href');
if ($(id).is(":visible")) {
$(this).text("Read More");
} else {
$(this).text("Read Less");
}
$(id).slideToggle(500);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment