I'm building a Wordpress theme and I have a problem with footer position. Index page is fine, I defined in style.css margin-top of "footer", witch holds bckimage to 900px and margin-top of "foot_sadrzaj" to 918px, because "foot_sadrzaj" holds text and images. Here's link: http://casabianca.ba/test/
Well, if I go to page, content of the page is in or, when displaying posts, in . I wrote some JS code to change position of a footer and foot_sadrzaj depending on position and height of sadrzaj or sadrzaj_single, elements containing content, but it doesn't work (like here: http://casabianca.ba/test/novosti/).... Can you help me figure out why?
Here,s the code:
var div = getElementById('sadrzaj');
var div2 = getElementById('sadrzaj_single');
if (div) {
var z = div.style.offsetTop+div.style.offsetHeight;
getElementById('footer').setAttribute(
"style", "marginTop:" + z.toString() + "px");
getElementById('foot_sadrzaj').setAttribute(
"style", "marginTop:" + (z+18).toString() + "px");
}
else if (div2) {
var z = div2.style.offsetTop+div2.style.offsetHeight;
getElementById('footer').setAttribute(
"style", "marginTop:" + z.toString() + "px");
getElementById('foot_sadrzaj').setAttribute(
"style", "marginTop:" + (z+18).toString() + "px");
}
Please, all I know is some JS and zero JQuery so answering something like "Try Jquery, I think that..." will not be helpfull at all....