samedi 31 janvier 2015

jQuery for each div class find child and insertAfter


Vote count:

0




Sorry I couldn't be more specific with the title. I am losing my mind over this xD Okay,so I am editing my blog theme and I need to move (cut and paste) specific div two divs under itself in specific blog post. I managed to make it work like this:



$(".blog_post.text_post .bottom_meta").insertAfter(".blog_post.text_post .moreinfo");


And on first sight it looks okay,but when I wrote another text post (usually posts are images) it makes a mess on my blog. The code now moves .bottom_meta from both posts under both .moreinfo .


I tried using each function but I failed multiple times...



$(".blog_post.text_post").each(function(){
$(this).children(".bottom_meta").insertAfter.$(this).children(".moreinfo");
});


I tried the same with 'find' function instad of 'children',still a fail.


Can anyone help me out with this or at least point me out to the right direction. Sorry for my bad English I hope you understand what am I trying to achieve.


Thanks, Mors.



asked 1 min ago







jQuery for each div class find child and insertAfter

Aucun commentaire:

Enregistrer un commentaire