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.

Special post color problem! [help please]

3 posters

Go down

In progress Special post color problem! [help please]

Post by axiom April 10th 2012, 2:21 am

I am adding it so a moderators post background color is green, and there font is black.

The only part NOT working is the font coloring part, the post background color IS working

Code:
$(function() {
$('tr.post:has(".specialpost2") td').css('background-color','#186111');
});

$(function() {
$('tr.post:has(".specialpost2") td').css('font-color','#000000');
});
avatar
axiom
Forumember

Posts : 29
Reputation : 1
Language : english

Back to top Go down

In progress Re: Special post color problem! [help please]

Post by axiom April 10th 2012, 6:03 am

^ didnt work:(
avatar
axiom
Forumember

Posts : 29
Reputation : 1
Language : english

Back to top Go down

In progress Re: Special post color problem! [help please]

Post by SLGray April 10th 2012, 6:14 am

Change 'background-color':'#186111','font-color':'#000000' to
'background-color','#186111','font-color','#000000'


Special post color problem! [help please] Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51464
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Special post color problem! [help please]

Post by LGforum April 10th 2012, 6:25 am

Have people not thought about doing this:
Code:

$(function() {
$('tr.post:has(".specialpost2") td').addClass('staffpost');
});

And then just styling it in the CSS? with
Code:

.staffpost {
  styling ...
}

Razz
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: Special post color problem! [help please]

Post by LGforum April 10th 2012, 4:54 pm

FYI Rideem this code has an error in:
Code:
$(function() {
$('tr.post:has(".specialpost2") td').css({'background-color':'#186111','font-color':'#000000');
});
Your missing the second '}' in the CSS() parameter.

For adding multiple CSS rules using jQuery you send an object in.
Code:

jQuery(selector).css({
      'color' : '#fff',
      'background' : '#000',
      'font-weight' : 'bold'
});

Just a regular Javascript Object structure.
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: Special post color problem! [help please]

Post by axiom April 10th 2012, 11:43 pm

Wait what, can you just tell me what to paste in the javascript and css Razz
avatar
axiom
Forumember

Posts : 29
Reputation : 1
Language : english

Back to top Go down

Back to top


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