The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to replace with font awesome

Go down

How to replace with font awesome Empty How to replace with font awesome

Post by Guest December 20th 2016, 2:05 pm

I'd really like to replace this heart image with font awesome, but I don't know how.

Code:
function VLIKE(b,a){
  a.onclick="#";
    $.get(b,function(){
    a.parentNode.style.display='none';
    a.parentNode.nextSibling.firstChild.className='positive';
    var c=a.parentNode.nextSibling.firstChild,
    b=parseInt(/\d+/.exec(c.innerHTML)[0])+1;
    c.innerHTML=c.innerHTML.replace(/\d+/,b);
    }
)};
$(function(){
var x = $('.vote').get();
for(i = x.length-1; i >= 0; i--){
  var numb = '0';

  var reputation_UP = 'http://twemoji.maxcdn.com/72x72/2764.png';

  var button = $(x[i]).find('.vote-button a').get();
  for(j=0; j < button.length; j++){
    if(button[j].innerHTML == '+'){
      reputation_UP = '<span onclick="VLIKE(\'' + button[j].href + '\',this);"><img src="'+reputation_UP+'" alt="+" class="rep_up"></span>';
    }
  }
  var bar = $(x[i]).find('.vote-bar')[0];
  if(bar){
      var s = bar.title.split(' ');
      var pct = parseInt(s[3].replace(/%/,''))/100;
      var num = parseInt(s[4].replace(/\(/,''));
      numb = String(Math.round(num*pct));
      reputation_UP = '<img src="'+reputation_UP+'" alt="+" class="rep_up">';
  }
    var votetext = numb;
    var Html = '<div class="rep_bar clearfix" id="rep_post">
                          <ul class="bs_inline">
                              <li>'+reputation_UP+'</li>
                              <li><span id="reput_vote">'+votetext+'</span></li>
                          </ul>
                        </div>';
$(x[i].parentNode.parentNode.parentNode.parentNode).find('.postfoot').before(Html);
  if(!bar){
$(x[i].parentNode.parentNode.parentNode.parentNode).find('#reput_vote').addClass('zero');
  }else{
$(x[i].parentNode.parentNode.parentNode.parentNode).find('#reput_vote').addClass('positive');
$(x[i].parentNode.parentNode.parentNode.parentNode).find('.rep_up').parents('li').css({"display":"none"});
  }
  x[i].parentNode.removeChild(x[i]);
}
});

I'd like to add this:

Code:
<font size="3px"><font color="red"><i class="fa fa-heart" aria-hidden="true"></i></font>

Instead of this:

Code:
var reputation_UP = 'http://twemoji.maxcdn.com/72x72/2764.png';

Can somebody send me the fix to this code to make it work properly, thanks. Smile
avatar
Guest
Guest


Back to top Go down

How to replace with font awesome Empty Re: How to replace with font awesome

Post by skouliki December 20th 2016, 2:11 pm

hello

change this 

Code:
var reputation_UP = 'http://twemoji.maxcdn.com/72x72/2764.png';

with this 

Code:
var reputation_UP = 'https://i37.servimg.com/u/f37/11/40/02/06/1235.png';
skouliki
skouliki
Manager
Manager

Female Posts : 12473
Reputation : 1528
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum