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.

Div Class Specific - jQuery

View previous topic View next topic Go down

Solved Div Class Specific - jQuery

Post by iProtiige on July 9th 2012, 3:27 pm

I was following a tutorial for changing a post background dependent on forum rank.

Code:
$(function() {
$('div.post:has(".specialpost"), div.postmain:has(".specialpost")').css('background-color','#000');
});

However, this code changes the entire post background. I tried changing it to the specific class 'posthead'.

Code:
$(function() { 
$('div.post:has(".owner"), div.postmain:has(".owner")')$('div.posthead').css('background-color','#3e5591'); 
});

Yet this doesn't seem to work at all (I'm most likely doing something wrong). The code works fine when the $('div.posthead') is removed but affects the wrong areas.

Any help is appreciated!


Last edited by iProtiige on July 9th 2012, 3:50 pm; edited 1 time in total

iProtiige
New Member

Posts : 2
Reputation : 1
Language : English

Back to top Go down

Solved Re: Div Class Specific - jQuery

Post by iProtiige on July 9th 2012, 3:49 pm

Turns out I just solved it! Very Happy

Since div.posthead had the {postrow.displayed.POSTER_RANK_NEW} on it I was able to change the code to have it find the rank off of the posthead rather than the entire post.

Code:
$(function() { 
$('div.head:has(".owner"), div.posthead:has(".owner")').css('background-color','#3e5591'); 
});

Solved

iProtiige
New Member

Posts : 2
Reputation : 1
Language : English

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