Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function( $ ){
- $(window).load(function() {
- function stickyFooter() {
- var bodyHeight = $("body").height();
- var vwptHeight = $(window).height();
- if (vwptHeight > bodyHeight) {
- $("#footer-section").css("position","absolute").css("bottom",0);
- $("#footer-section").addClass('sticky');
- }
- else {
- $("#footer-section").css("position","static");
- $("#footer-section").removeClass('sticky');
- }
- } stickyFooter();
- /*resize*/
- var isIE8 = $.browser.msie && +$.browser.version === 8;
- if (isIE8) {
- document.body.onresize = function () {
- stickyFooter();
- };
- } else {
- $(window).resize(function () {
- stickyFooter();
- });
- }
- // Orientation change
- window.addEventListener("orientationchange", function() {
- stickyFooter();
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement