Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).foundation();
- var pathname = location.pathname;
- var styleEl = 'margin';
- if(pathname != '/bobdesign/steigerscorporation/' && pathname != '/'){
- window.onload = function() {
- stickyFooter();
- //you can either uncomment and allow the setInterval to auto correct the footer
- //or call stickyFooter() if you have major DOM changes
- //setInterval(checkForDOMChange, 1000);
- };
- function checkForDOMChange() {
- stickyFooter();
- }
- window.onresize = function() {
- stickyFooter();
- }
- function getCSS(element, property) {
- var elem = document.getElementsByTagName(element)[0];
- var css = null;
- if (elem.currentStyle) {
- css = elem.currentStyle[property];
- } else if (window.getComputedStyle) {
- css = document.defaultView.getComputedStyle(elem, null).
- getPropertyValue(property);
- }
- return css;
- }
- function stickyFooter() {
- if (document.getElementsByTagName("footer")[0].getAttribute("style") != null) {
- document.getElementsByTagName("footer")[0].removeAttribute("style");
- }
- if (window.innerHeight != document.body.offsetHeight) {
- var offset = window.innerHeight - document.body.offsetHeight;
- var current = getCSS("footer", styleEl+"-top");
- if (isNaN(current) == true) {
- document.getElementsByTagName("footer")[0].setAttribute("style", styleEl+"-top:20px;");
- current = 0;
- } else {
- current = parseInt(current);
- }
- if (current+offset > parseInt(getCSS("footer", "margin-top"))) {
- document.getElementsByTagName("footer")[0].setAttribute("style",styleEl+"-top:"+(current+offset)+"px;");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement