<reponame>kamekame0712/laravel_od<filename>public/js/front.top.js
jQuery( function($) {

	$('.btn-show > i').removeClass('fa-chevron-up');
	$('.btn-show > i').addClass('fa-chevron-down');
	$('.example-unit').css('display', 'none');

	var current_url = location.href;
	if( current_url.indexOf('#') != -1 ) {
		scrollBy(0, -50);
	}

});

$('.btn-show').click( function() {
	var obj = $(this).next('div');

	if( obj.css('display') == 'none' ) {
		$(this).html('&lt;選択単元例&gt;を隠す&nbsp;<i class="fas fa-chevron-up"></i>');
		obj.slideDown();
	}
	else {
		$(this).html('&lt;選択単元例&gt;を見る&nbsp;<i class="fas fa-chevron-down"></i>');
		obj.slideUp();
	}
});