Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <button class="btn btn-default buttonattr"style="font-family:Pangolin" onclick="myhit(''+this["post"]+'',''+this["love"]+'');myclick()"><span class="glyphicon glyphicon-heart fa-lg notactive" ></span> Love</button><pre id="love">'+this["love"]+' students<i class="glyphicon glyphicon-heart fa-lg" style="color:red">
  2.  
  3. var toAdd=1;var newValue=0;
  4. var overall=1;
  5. function myhit(post,love){
  6.  
  7. oldValue=parseInt(love);
  8. if(toAdd>0){
  9. newValue= oldValue + toAdd;
  10. }
  11. else{
  12. newValue=overall+toAdd;
  13. }
  14. toAdd *= -1;
  15. overall=newValue;
  16. $.post('porthome4_.php',{post1:post,love:newValue},function(info){});
  17. }
  18. function myclick(){
  19. $('.buttonattr').click(function(){
  20. $(this).find('#love').html(overall);
  21. $(this).find('#love').append(' students<span class="glyphicon glyphicon-heart fa-lg "a style="color:red" ></span>');
  22. });
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement