0

I have searched here on SO and tried different solutions offered here, but cannot seem to find a solution that works.

What I want to do is to have the Facebook comments show up below the text "Hvis du kan lide mit blog..."

I think what needs to be done is to change the order of <div id="selmakjaerbo_below_blogposts"> and <div class="fb-comments fb-social-plugin" ... ></div> on this page: http://selmakjaerbo.dk/hvornar-har-du-sidst-investeret-i-dig-selv/

...but I am too novice in this to be sure, unfortunately.

Can anyone help, please?

rassom
  • 2,896
  • 5
  • 34
  • 45
  • 3
    http://stackoverflow.com/questions/7628627/change-order-divs-with-jquery – Tats_innit Jun 25 '12 at 11:04
  • Thanks :-) Did find and try that solution and it didn't work (but maybe I implemented it wrongly) – rassom Jun 25 '12 at 11:11
  • You can't really expect integration code to be provided for you as well. Sometimes you get that (Like on sundays when it's hard to get rep :D) but it's not the norm here. – Esailija Jun 25 '12 at 11:16

1 Answers1

4

You can use insertAfter:

$("#selmakjaerbo_below_blogposts").insertAfter(".fb-comments");​

Or before:

$("#selmakjaerbo_below_blogposts").before($(".fb-comments"));​

UPDATE. Based on your code you'd better use insertBefore inside DOM ready handler:

$(function() {
    $("#selmakjaerbo_below_blogposts").insertBefore(".fb-comments");
});
VisioN
  • 143,310
  • 32
  • 282
  • 281
  • Thanks :) I saw that in another solution here on SO and tried it, but maybe I am using it wrongly, because it doesn't seem to work (if you view source on the page you can see that I've added it with – rassom Jun 25 '12 at 11:13
  • You are trying to work with `#selmakjaerbo_below_blogposts` when the element is not yet fully loaded. Add this code inside `$(function() { ... });` and it should do the job. – VisioN Jun 25 '12 at 11:18
  • Like this? ... just tried that, and it doesn't seem to work :) Thanks so much for helping. Really appreciate it! :) – rassom Jun 25 '12 at 11:23
  • Also tried this, still not working: – rassom Jun 25 '12 at 11:25
  • @rassom Nope :) As I see from your code it should be `insertBefore` and the last parenthesis should be after last bracket. Check the update. – VisioN Jun 25 '12 at 11:27