gets app completly uptodate with prototype
This commit is contained in:
12
lms/static/js/sticky_filter.js
Normal file
12
lms/static/js/sticky_filter.js
Normal file
@@ -0,0 +1,12 @@
|
||||
$(function() {
|
||||
var offset = $('.filter nav').offset().top;
|
||||
|
||||
$(window).scroll(function() {
|
||||
if (offset <= window.pageYOffset) {
|
||||
return $('.filter nav').addClass('fixed-top');
|
||||
}
|
||||
else if (offset >= window.pageYOffset) {
|
||||
return $('.filter nav').removeClass('fixed-top');
|
||||
}
|
||||
});
|
||||
});
|
||||
23
lms/static/js/sticky_footer.js
Normal file
23
lms/static/js/sticky_footer.js
Normal file
@@ -0,0 +1,23 @@
|
||||
$(function() {
|
||||
var stickyFooter = function(){
|
||||
var pageHeight = $('html').height();
|
||||
var windowHeight = $(window).height();
|
||||
var footerHeight = $('footer').outerHeight();
|
||||
|
||||
var totalHeight = $('footer').hasClass('fixed-bottom') ? pageHeight + footerHeight : pageHeight;
|
||||
|
||||
|
||||
if (windowHeight < totalHeight) {
|
||||
return $('footer').removeClass('fixed-bottom');
|
||||
} else {
|
||||
return $('footer').addClass('fixed-bottom');
|
||||
}
|
||||
};
|
||||
|
||||
stickyFooter();
|
||||
|
||||
$(window).resize(function() {
|
||||
console.log("resizing");
|
||||
stickyFooter();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user