Guest User

Untitled

a guest
Oct 31st, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var words = ['мегафон', 'republic', 'apple'];
  2.  
  3. $(document).ready(function() {
  4.     remove_posts();
  5.     $(document).on( "click", function() {
  6.         setTimeout(function () {
  7.             remove_posts();
  8.         },1500);
  9.     });
  10. });
  11.  
  12. function remove_posts()
  13. {
  14.     $('.b-article h2 span').each(function( index ) {
  15.         var title = $( this ).text();
  16.         var title_low = title.toLowerCase();
  17.         $.each(words, function( index, word ) {
  18.             var word_low = word.toLowerCase();
  19.             var includes = title_low.includes(word_low);
  20.  
  21.             if (includes == true) {
  22.                 var post = ".b-article h2 span:contains('" + title +"')";
  23.                 $(".feed__container").find(post).closest(".feed__item").hide();
  24.             }
  25.         });
  26.     });
  27. }
Advertisement
Add Comment
Please, Sign In to add comment