Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

How to fix non sticking sticky footer with Jquery.


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 7, 2012, 12:43 PM
lakewooditsupport
 
48 posts · Jun 2011
England, United Kingdom
I've had this problem with a few versions of Atahualpa now where the footer stops sticking when selected to stick to the bottom of the screen, I'm not sure what the problem was or what if any plugin is conflicting but it seems to be a common problem. I decided to make a fix and it works perfectly on my site across all up to date browsers.

You can use the jquery script below, in the header or include it in your javascript file if you have one.

Code:
$(function(){
	positionFooter(); 
	function positionFooter(){
		var padding_top = $("#footer").css("padding-top").replace("px", "");
		var page_height = $(document.body).height() - padding_top;
		var window_height = $(window).height();
		var difference = window_height - page_height;
		if (difference < 0) 
			difference = 0;
 
		$("#footer").css({
			padding: difference + "px 0 0 0"
		})
	}
 
	$(window)
		.resize(positionFooter)
});
Its essentially the same as the atahualpa script but this works where the default did.
  #2  
Old May 8, 2012, 03:50 AM
juggledad's Avatar
juggledad
 
22,176 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
doesn't work for me in Safari or firefox on the Mac.

I put it in the ato->Add HTML/CSS Inserts->HTML Inserts: Header and it just displayed the code on the screen. I then surrounded it with '<script type="text/javascript">' and '</script>' and left ato->Style & edit FOOTER->Sticky footer on short pages? set to 'NO' and the footer was not sticky. With it set to 'YES' I get both this code and the atahualpa code and it works fine...but which is working?
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
Juggledad | Forum Moderator/Support
  #3  
Old May 8, 2012, 07:02 AM
lakewooditsupport
 
48 posts · Jun 2011
England, United Kingdom
I have no to sticky footer enabled in ATO, but the footer wasn't sticking, it did at first but must have stopped after a changes and plugins were installed.

I have removed the atahualpa javascript for the sticky footer from the js.php file and used the script above in my own javascript file. I then disabled sticky footer in options, its working in all browsers for me on PC & Mac.

It may be conflicting with other JS for you or even the original sticky footer JS. May not work for all but it fixed it for me after months on changing settings and using different methods.

Bookmarks

Tags
sticky footer

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sticky Footer in IE8 not working jodybethw Post-Kicker, -Byline & -Footer 2 Mar 28, 2012 12:59 PM
Sticky page footer not sticking Inblingham Post-Kicker, -Byline & -Footer 1 Mar 6, 2011 03:15 AM
Floating above a sticky footer? pjbfcp Atahualpa 3 Wordpress theme 2 Feb 11, 2011 01:56 PM
Sticky Footer krystyna Post-Kicker, -Byline & -Footer 1 Jul 12, 2009 05:21 AM


All times are GMT -6. The time now is 10:21 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.