Home  >  Article  >  Web Front-end  >  jQuery simply implements QQ space likes and cancels likes_jquery

jQuery simply implements QQ space likes and cancels likes_jquery

WBOY
WBOYOriginal
2016-05-16 16:05:561429browse

I saw that some netizens created dynamic likes for space friends, adding and canceling like functions. Directly run script

Friend dynamic like code

jQuery("a.qz_like_btn_v3[data-clicklog='like']").each(function(index,item){
  console.log(item);
  jQuery(item).trigger('click');
});
jQuery(window).scroll(function(){
  jQuery("a.qz_like_btn_v3[data-clicklog='like']").each(function(index,item){
    jQuery(item).trigger('click');
  }); 
  return true;
});

Cancel Like

jQuery("a.qz_like_btn_v3[data-clicklog='cancellike']").each(function(index,item){
  console.log(item);
  jQuery(item).trigger('click');
});
jQuery(window).scroll(function(){
  jQuery("a.qz_like_btn_v3[data-clicklog='cancellike']").each(function(index,item){
    jQuery(item).trigger('click');
  }); 
  return true;
});

The above is the entire content of this article, I hope you all like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn