Created
September 26, 2022 08:43
-
-
Save wibawasuyadnya/abefa23e6201d16fdcbbca94bed2fa2e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//in page search filter with callback if no result found// | |
jQuery(document).ready(function($){ | |
var $search = $("#inpsearch-bar").on('input',function(){ | |
var matcher = new RegExp($(this).val(), 'gi'); | |
$('.filter-box').show().not(function(){ | |
return matcher.test($(this).find('.name').text()) | |
}).hide(); | |
if($('.filter-box:visible').length===0){ | |
$('.noresult').show(); | |
} else { | |
$('.noresult').hide(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment