Last active
November 4, 2016 22:45
-
-
Save parsakafi/77e18eeb23bca4731e01ebbb2211c79a to your computer and use it in GitHub Desktop.
Fix Footer With CSS & Jquery/JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Fix Footer With CSS & Jquery/JS</title> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> | |
<script src="public.js"></script> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<footer class="footer_s"> | |
copyright 2016 PARSA.WS, all rights reserved. | |
</footer> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
remove_footer_class(); | |
}); | |
function remove_footer_class() { | |
if ($("body").height() > $(window).height()) { | |
$("footer").removeClass("footer_s"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
footer { | |
background-color: #f8f8fa; | |
padding: 1.5rem; | |
color: #9e9ea0; | |
} | |
.footer_s { | |
position: absolute; | |
bottom: 0px; | |
left: 0px; | |
width: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment