Swapping homepage boxes

So let’s say you want friends and family down at the bottom of the page and you galleries up higher. This code will do it for you:


// look to swap after the page is loaded
onload = swapFF;
// the swap function
function swapFF() {
     // look at the body tags classes, if it is the homepage then swap
     bodyClass = document.getElementsByTagName("body")[0].className;
     if (bodyClass.indexOf("homepage") != -1) {
          swap = document.getElementById("ffBox").innerHTML;
          document.getElementById("ffBox").innerHTML = document.getElementById("galleriesBox").innerHTML;
          document.getElementById("galleriesBox").innerHTML = swap;
     }
}

2 Responses to “Swapping homepage boxes”

  1. Scott Says:

    So where do we put this code on the co-branding page? I have tried each one, and none produce the effect described on the homepage. :(

  2. doctorit Says:

    This works, BUT, not perfectly. It moves the Featured Galleries down as well. My goal with this was to get: bio, featured galleries, galleries, FF – instead, I got: bio, galleries, featured galleries, FF.

    Are FF and featured galleries somehow linked???

Leave a Reply