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.

Message Background Javascript Not working as Well

2 posters

Go down

Message Background Javascript Not working as Well Empty Message Background Javascript Not working as Well

Post by SpyroDragon May 25th 2015, 01:18

As well as the name color, my background javascript has seemed to stop working, unless iv screwd the script up somehow


Code:
$(function() {
 customBg('Spyro ▀█▀ Dragon', 'Spyro-background', 'http://i19.servimg.com/u/f19/16/87/57/90/spyro_10.jpg');
 
  function customBg(name, classname, image) {
    var ua = window.navigator.userAgent, td = 'td', pos = '';
    $('.post:has(.name:contains('+name+'))').addClass(classname);
    if (ua.match(/Chrome/)) td = 'td:last-child', pos = '140% 0';
    if (ua.indexOf('MSIE ') > 0 || ua.match(/Trident/) || ua.match(/Chrome/)) $('head').append('<style type="text/css">.post.'+classname+' > '+td+' { background:none }.post.'+classname+' {background: url('+image+') no-repeat '+pos+' transparent }</style>');
    else $('head').append('<style type="text/css">.post.'+classname+' td { background:none }.post.'+classname+' {background: url('+image+') no-repeat center center / 100% 100% transparent }</style>');
  }
});
SpyroDragon
SpyroDragon
Forumember

Posts : 462
Reputation : 2
Language : English

http://tlos.forumotion.net/

Back to top Go down

Message Background Javascript Not working as Well Empty Re: Message Background Javascript Not working as Well

Post by Niko May 25th 2015, 17:31

Hello @SpyroDragon

it seems that the code works correctly and that there are no errors in de syntax Wink

Have you installed other javascripts before this one?
Niko
Niko
Helper
Helper

Male Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Back to top

- Similar topics

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