The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to replace with font awesome

View previous topic View next topic Go down

How to replace with font awesome

Post by Zuke on 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
Zuke
Forumember

Male Posts : 385
Reputation : 21
Language : English
Location : United Kingdom

http://droplet.your-talk.com

Back to top Go down

Re: How to replace with font awesome

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

hello

change this

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

with this

Code:
varreputation_UP='https://i37.servimg.com/u/f37/11/40/02/06/1235.png';
avatar
skouliki
Graphic Designer
Graphic Designer

Female Posts : 3148
Reputation : 492
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

View previous topic View next topic Back to top


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