Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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">
- var toAdd=1;var newValue=0;
- var overall=1;
- function myhit(post,love){
- oldValue=parseInt(love);
- if(toAdd>0){
- newValue= oldValue + toAdd;
- }
- else{
- newValue=overall+toAdd;
- }
- toAdd *= -1;
- overall=newValue;
- $.post('porthome4_.php',{post1:post,love:newValue},function(info){});
- }
- function myclick(){
- $('.buttonattr').click(function(){
- $(this).find('#love').html(overall);
- $(this).find('#love').append(' students<span class="glyphicon glyphicon-heart fa-lg "a style="color:red" ></span>');
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement