There's some code for replace a text to a image (emoticon)?
Last edited by Chavo on March 20th 2014, 6:01 am; edited 1 time in total
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
For HTML
<img src="IMG Link here" title="Title of image" />
For BBC
[img]IMG Link[/img]
var Smileys;
Smileys = {
'Lara com Z' : 'http://i738.photobucket.com/albums/xx29/forummultix/emoticons/Lara7_zps32c7c5d6.gif',
'Gretchen' : 'http://i738.photobucket.com/albums/xx29/forummultix/emoticons/gretchensaindo_zpsbb7eafc6.gif',
'Falta de sacanagem' : 'http://i738.photobucket.com/albums/xx29/forummultix/emoticons/putafaltadesacanagem_zps162a2df9.gif',
};
$(function() {
$.each(Smileys, function(key, value) {
$('img[alt="' + key + '"]').attr('src', value);
});
});
$(function() {
var c = document.getElementsByClassName('entry-content');
for (i=0; i<c.length; i++) {
c[i].innerHTML = c[i].innerHTML.replace(/:cool:/g,'<img src="http://2img.net/i/fa/i/smiles/icon_cool.gif"/>');
c[i].innerHTML = c[i].innerHTML.replace(/:sad:/g,'<img src="http://2img.net/i/fa/i/smiles/icon_sad.gif"/>');
}
});