javascript - Move around dynamic divs in blog post listings -
i working blog , want move category above title on each post listing. when use following code 50 clones of first category. think need using index parameter of .each()
i'm not sure. here's code:
jquery(document).ready(function(){ jquery(".blog-category").each(function(){ jquery(this).insertbefore( jquery(".blog-head") ) ; }); });
essentially i'm trying insert
.blog-category
before
.blog-head
on each post.
html
<div id="entry-2839"> <div class="blog-post-in"> <div class="blog-head">content</div> <div class="blog-side"> <div class="blog-category">more content</div> </div> </div> </div>
this should trick:
var e = jquery(this); e.closest(".blog-post-in").prepend(e);
Comments
Post a Comment