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.

Editing post colors via Javascript - Won't work now

3 posters

Go down

Solved Editing post colors via Javascript - Won't work now

Post by MDillon March 7th 2014, 6:03 am

So, yesterday, I stumbled upon this thread... https://help.forumotion.com/t127662-how-to-change-post-text-background-color-change

I followed the steps and they all worked like a charm. The code was perfect and didn't seem to slip up.

However, today, after changing a bit of the CSS (not much, just working on hovers)... the post color went back to normal and I can't seem to get the colors to work again.

This is bugging me... and I need help...

I have a Phpbb2 base, if you couldn't tell from the post or what not.

Thanks in advance!
avatar
MDillon
New Member

Posts : 6
Reputation : 1
Language : English

http://steadfast.betaboard.net

Back to top Go down

Solved Re: Editing post colors via Javascript - Won't work now

Post by masesm March 7th 2014, 6:49 am

Check and see if you have these variables used anywhere other than the script provided by Ange:

Code:
td.row1.jaune-post:nth-child(2),td.row2.jaune-post:nth-child(2){
background:#f0f0f0 url('http://i56.servimg.com/u/f56/18/21/60/73/jaune10.png') repeat-y
}
td.row1.vert-post:nth-child(2),td.row2.vert-post:nth-child(2){
background:#f0f0f0 url('http://i56.servimg.com/u/f56/18/21/60/73/vert10.png') repeat-y
}
masesm
masesm
Forumember

Male Posts : 75
Reputation : 7
Language : Java, C++, C#, Python, JavaScript, PHP, MySQL, AWS
Location : United States

http://sicktier.forumotion.com/

Back to top Go down

Solved Re: Editing post colors via Javascript - Won't work now

Post by MDillon March 7th 2014, 8:43 am

Sadly, I did not put this code anywhere else. I didn't even mess with any code like it. I only edited the CSS and Javascript... I still can't figure it out...
avatar
MDillon
New Member

Posts : 6
Reputation : 1
Language : English

http://steadfast.betaboard.net

Back to top Go down

Solved Re: Editing post colors via Javascript - Won't work now

Post by Ange Tuteur March 7th 2014, 6:50 pm

Hello MDillon,

I have check your CSS and you're making the selectors invalid by placing 2 slashes a text before it.

Example :
Code:
//END CHATBOX td.row1.jaune-post:nth-child(2), td.row2.jaune-post:nth-child(2) {
background:#f0f0f0 url(http://i62.tinypic.com/dr436u.png) repeat-y
}

That is commonly a single line comment for languages like javascript. This is NOT supported in CSS. Instead you must write comments as :
Code:
/* THIS IS A COMMENT */
td.row1.jaune-post:nth-child(2), td.row2.jaune-post:nth-child(2) {
background:#f0f0f0 url(http://i62.tinypic.com/dr436u.png) repeat-y
}

Review your CSS and edit the single line comments to fix any errors.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Editing post colors via Javascript - Won't work now

Post by MDillon March 7th 2014, 8:11 pm

Thank you very much! I'm so used to using comments in my coding that I didn't realize that it doesn't work on CSS... Simple mistake, but thank you! Smile
avatar
MDillon
New Member

Posts : 6
Reputation : 1
Language : English

http://steadfast.betaboard.net

Back to top Go down

Solved Re: Editing post colors via Javascript - Won't work now

Post by Ange Tuteur March 7th 2014, 9:56 pm

You're welcome I love you

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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