├── README.md
└── stickyFooter.js
/README.md:
--------------------------------------------------------------------------------
1 | Sticky Footer
2 | ======================
3 | The Sticky footer will use the HTML5 tag < footer > and make it "stick" to the bottom of the page.
4 | Simply add in < footer > footer > to your webpage with your desired styled content inside the < footer > tag.
5 | You may pre-style the < footer > in your css file.
6 | The stiky footer will remember your original styles if the page is not long enough to "stick" to the bottom of the page! Even after resize!
7 | There are no requirements for CSS! No 100% Body Height!
8 | You don't need a fixed height, or a wrapper!
9 |
10 | It even works in mobile and tablet!
11 |
12 |
13 | FAQ's as they come up.
14 | =====================
15 |
16 | Q: What about HTML 5 allowing for multiple footer tags?
17 |
18 | A: Sticky Footer will only stick the last < footer > on your page.
19 |
20 | Q: Do I need to apply 100% height to my body?
21 |
22 | A: This has been changed from don't to does not matter. New sticky footer will still work with height 100%
23 |
24 | Q: How do I span the full width of the browser with my footer in Foundation?
25 |
26 | A: If you would like to have your footer span the full width of the browser, apply a style to the footer.
27 | footer { background-color:red; }
28 | This will give you a full width bar with a background color of red.
29 |
30 | A more robust example being a 2 column grid respecting footer with a full width bg red and a margin top of 100px when the footer is longer than the height of the page.
31 |
32 | ```
33 | *app.css*
34 | footer { background-color:red; margin-top:100px }
35 |
36 | *html*
37 |
47 | ```
48 |
49 |
50 | Q: Will this work with out Foundation?
51 |
52 | A: Yes! This sticky footer will work with out Foundation. I build it with Foundation in mind cause that is what I use.
53 |
54 |
55 |
56 | HELPERS:
57 |
58 | Please DO NOT apply any classes to the footer IE < footer class="row" > If you would like your row content to respect the grid plase place the row and column(s) inside the < footer > tag. The stickyFooter will not work proprly if you class it with foundation's grid classes.
59 |
60 | If you would like your footer to be 'hidden' before the sticky footer 'sticks' the footer at the bottom apply an inline style on your footer tag. This will eliminate a 'jump' in the footer to the bottom of the page.
61 | ```
62 |
65 | ```
66 |
--------------------------------------------------------------------------------
/stickyFooter.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * jQuery Sticky Footer 2.3
3 | * Corey Snyder
4 | * http://tangerineindustries.com
5 | *
6 | * Released under the MIT license
7 | *
8 | * Copyright 2013 Corey Snyder.
9 | *
10 | * Date: Thu Jan 22 2013 13:34:00 GMT-0630 (Eastern Daylight Time)
11 | * Modification for jquery 1.9+ Tue May 7 2013
12 | * Modification for non-jquery, removed all, now classic JS Wed Jun 12 2013
13 | * Modification for Foundation 5 auto height issues
14 | * Modification for new DOM change event listener
15 | * Modification for old IE mutation events, since not supported uses polling
16 | *
17 | * March 13, 2017
18 | * Modification for HTML multiple