Thread: Resolved Jquery nth term append
View Single Post
Old 11-13-2012, 08:24 PM   PM User | #1
CHEWX
Regular Coder

 
Join Date: Dec 2010
Posts: 124
Thanks: 17
Thanked 6 Times in 6 Posts
CHEWX is an unknown quantity at this point
Jquery nth term append

Hey,

Not sure if this is the right section, but I am currently running a wordpress loop for the search page. It displays the results in two different templates.

One of the templates I want to apply a clear both to the second one.

Link: http://admiretheweb.com/?s=the

The loop works like so.

Get posts, if in cat xx show in template a else show the rest in template b.

Templates b needs a clear on the second div, I did this by the following:

Code:
$(document).ready(function() {
$("#article-inspir:nth-child(2n)").append("<div style='clear:both;'></div>");
});
I've tried wrapping the div different quote styles, but it's not selecting the nth-child and applying the clear.

E.g:

Code:
$(document).ready(function() {
$("#article-inspir:nth-child(2n)").append("<div style="clear:both;"></div>");
});
Code:
$(document).ready(function() {
$("#article-inspir:nth-child(2n)").append('<div style="clear:both;"></div>');
});
Why ?

Last edited by CHEWX; 11-14-2012 at 08:48 PM..
CHEWX is offline   Reply With Quote