Created
January 15, 2021 03:41
-
-
Save bryanrsebastian/df871eb0559fb4a25d47f3cf0fc4a6d6 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
$( document ).ready( function() { | |
/** Features Recent Posts Search Functionality **/ | |
$( '#__search_recent' ).keyup( function( event ) { | |
var search = $( this ).val().toUpperCase(); | |
$( '#features_archive .__recent_post_sub_container' ).each( function( index, el ) { | |
if( $( 'a', el ).text().toUpperCase().indexOf( search ) > -1 ) { | |
$( el ).show(); | |
// $(".__recent_post_sub_container:nth-of-type(11)").addClass('hide-post'); | |
// $(".__recent_post_sub_container:nth-of-type(12)").addClass('hide-post'); | |
$(".__recent_post_sub_container:nth-of-type(11)").removeClass('hide-post-hidden'); | |
$(".__recent_post_sub_container:nth-of-type(12)").removeClass('hide-post-hidden'); | |
} else { | |
$( el ).hide(); | |
} | |
} ); | |
if ( search == '' ) { | |
$(".__recent_post_sub_container:nth-of-type(11)").addClass('hide-post-hidden'); | |
$(".__recent_post_sub_container:nth-of-type(12)").addClass('hide-post-hidden'); | |
} | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment