소스 검색

footer fix

anatoly 6 년 전
부모
커밋
ca96d4028b
4개의 변경된 파일19개의 추가작업 그리고 28개의 파일을 삭제
  1. 1 1
      src/files/css/main.css
  2. 0 0
      src/files/css/main.css.map
  3. 17 26
      src/files/js/script.js
  4. 1 1
      src/files/scss/_base-style.scss

+ 1 - 1
src/files/css/main.css

@@ -6580,7 +6580,7 @@ body {
   position: relative;
   padding-bottom: 333px; }
   body footer {
-    bottom: auto; }
+    bottom: 0; }
 
 header {
   position: fixed;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
src/files/css/main.css.map


+ 17 - 26
src/files/js/script.js

@@ -1,11 +1,3 @@
-function setFooterHeight() {
-    $('body').css('padding-bottom', $("footer").outerHeight());
-}
-
-$(window).resize(function () {
-    setFooterHeight();
-});
-
 $(document).ready(function () {
 
     $('.menu .burger').on('click', function () {
@@ -43,17 +35,17 @@ $(document).ready(function () {
         }
     });
 
-    $('#searchToggle').click(function (e) {
+    $('#searchToggle').click(function(e) {
         e.preventDefault();
         $("#searchForm").toggleClass('header-search--active')
     });
     let personal_list = $('.personals__tile-list');
-    if (personal_list.length) {
+    if(personal_list.length){
         let personal_title = $('.personals__tile').find('.personals__position');
         var title_heigh = 0;
-        $.each(personal_title, function (index, value) {
+        $.each(personal_title,function(index, value){
             let temp_height = $(value).height();
-            if (title_heigh < temp_height) {
+            if(title_heigh < temp_height){
                 title_heigh = temp_height;
             }
         });
@@ -71,14 +63,13 @@ $(document).ready(function () {
             $content.slideToggle();
         });
     })($);
-    setFooterHeight();
 });
-$(window).on('load', function () {
-    (function ($) {
+$(window).on('load',function(){
+    (function($){
         var body = $('html, body');
         var _bodyHeight = undefined;
-        const getBodyHeight = function () {
-            if (_bodyHeight === undefined) {
+        const getBodyHeight = function() {
+            if(_bodyHeight === undefined) {
                 _bodyHeight = $('body').outerHeight() || $('html').outerHeight();
             }
             return _bodyHeight;
@@ -87,11 +78,11 @@ $(window).on('load', function () {
         const footerHeight = 333;
         const scrollOffset = 30;
         const scrollToShow = 400;
-        const getScroll = function () {
+        const getScroll = function() {
             return $('body').scrollTop() || $('html').scrollTop();
         };
-        const getButtonPos = function () {
-            if (getScroll() + windowHeight > getBodyHeight() - footerHeight) {
+        const getButtonPos = function() {
+            if(getScroll() + windowHeight > getBodyHeight() - footerHeight) {
                 const currentScroll = (getScroll() + windowHeight);
                 const bodyFooter = (getBodyHeight() - footerHeight);
                 return (scrollOffset + (currentScroll - bodyFooter));
@@ -100,26 +91,26 @@ $(window).on('load', function () {
             }
         };
 
-        if (body.height() > windowHeight && body.width() > 1023) {
+        if(body.height() > windowHeight && body.width() > 1023) {
             var button = $('<div class="go-top-link"></div>')
                 .css({
                     'position': 'fixed',
                     'bottom': getButtonPos() + 'px',
                     'left': '30px'
-                }).click(function () {
+                }).click(function(){
                     body.animate({'scrollTop': 0});
                 }).hide();
             body.append(button);
             var isShown = false;
-            if (getScroll() >= scrollToShow) {
+            if(getScroll() >= scrollToShow) {
                 button.fadeIn();
                 isShown = true;
             }
-            $(window).on('scroll', function () {
-                if (getScroll() >= scrollToShow && !isShown) {
+            $(window).on('scroll', function(){
+                if(getScroll() >= scrollToShow && !isShown) {
                     button.stop().fadeIn();
                     isShown = true;
-                } else if (getScroll() < scrollToShow && isShown) {
+                } else if(getScroll() < scrollToShow && isShown) {
                     button.stop().fadeOut();
                     isShown = false;
                 }

+ 1 - 1
src/files/scss/_base-style.scss

@@ -17,7 +17,7 @@ body {
     padding-bottom: 333px;
 
     footer {
-        bottom: auto;
+        bottom: 0;
     }
 }
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.