Facebook Emoticon Reaction

If you are looking for a Facebook Emoticon Reaction you are at the right place to deal with it. This tutorial will help you how to create a like reaction script . This projects reacts to the statuses that you posted. I have a sample code below. Result

Sample Code

Javascript Query
  1. $(document).ready(function(){
  2.   $(".reaction").on("click",function(){
  3.         var data_reaction = $(this).attr("data-reaction");
  4.         $(".like-details").html("Your Friends and 1k others like this!");
  5.         $(".like-btn-emo").removeClass().addClass('like-btn-emo').addClass('like-btn-'+data_reaction.toLowerCase());
  6.         $(".like-btn-text").text(data_reaction).removeClass().addClass('like-btn-text').addClass('like-btn-text-'+data_reaction.toLowerCase()).addClass("active");;
  7.  
  8.         if(data_reaction == "Like")
  9.           $(".like-emo").html('<span class="like-btn-fist"></span>');
  10.         else
  11.           $(".like-emo").html('<span class="like-btn-fist"></span><span class="like-btn-'+data_reaction.toLowerCase()+'"></span>');
  12.   });
  13.  
  14.   $(".like-btn-text").on("click",function(){
  15.           if($(this).hasClass("active")){
  16.                   $(".like-btn-text").text("Like").removeClass().addClass('like-btn-text');
  17.                   $(".like-btn-emo").removeClass().addClass('like-btn-emo').addClass("like-btn-default");
  18.                   $(".like-emo").html('<span class="like-btn-fist"></span>');
  19.                   $(".like-details").html("Your Friends and 1k others like this!");
  20.                  
  21.           }      
  22.   })
  23. });
Hope that you like it. Enjoy Coding.

Add new comment