Last active
May 19, 2018 02:21
-
-
Save schaeken/38589c3fa9091cc0538e to your computer and use it in GitHub Desktop.
Add "View More" functionality to Supply's sidebar filtering.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Place this just before the end of the body -> </body> | |
{% endcomment %} | |
<script> | |
jQuery(function($) { | |
$('.sidebar-module__viewmore').on('click', function() { | |
$(this).prev('.sidebar-module__list').toggleClass('sidebar-module__list--expand'); | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Place the following add the end of this file | |
{% endcomment %} | |
.sidebar-module__hidden-item { | |
display: none; | |
} | |
.sidebar-module__collapse { | |
display: none; | |
} | |
.sidebar-module__viewmore { | |
top: -25px; | |
position: relative; | |
} | |
.sidebar-module__list--expand { | |
.sidebar-module__hidden-item { | |
display: block; | |
} | |
+ .sidebar-module__viewmore .sidebar-module__expand { | |
display: none; | |
} | |
+ .sidebar-module__viewmore .sidebar-module__collapse { | |
display: inline-block; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This didn't work for me: www.mobilepharmacy.ca. Any advice would be great! Thanks!