2016-07-14 60 views
0

我是新來的CSS。修復頭部在跳躍時,底部的底部

我怎麼能在這個頁面的頁面

我的問題的完整的底部顯示頁腳:http://techdefeat.com/index.php

.technology { 
    min-height: 203em; 
} 

.foot-nav { background: #fa4b2a;} 

在CSS這個唯一的頁腳我有。

請給出一些簡單的參考,感謝您的幫助。

+0

請分享您的代碼,以便我們可以幫助您解決問題:) – RasmusGlenvig

+0

您能否看到頁面源代碼? – Developer

+0

是的,但是如果您爲您分享相關的代碼問題,而不是「僅僅看到頁面源代碼」,它可以讓我們更容易地幫助您。到目前爲止,你有什麼試圖做的? – RasmusGlenvig

回答

0

這裏是我的頭解決方案。

CSS

.head-bottom { 
    background: #fa4b2a; 
    position:fixed; 
    width:100%; 
    z-index:100; 
} 

.tech-no { 
    /* position: absolute; */ 
    /top: -33px;/
} 

JS

$(window).scroll(function(e){ 
    var $el = $('.head-bottom'); 
    var isPositionFixed = ($el.css('position') == 'fixed'); 
    if ($(this).scrollTop() > 200 && !isPositionFixed){ 
    $('.head-bottom').css({'position': 'fixed', 'top': '0px'}); 
    } 
    if ($(this).scrollTop() < 200 && isPositionFixed) 
    { 
    $('.head-bottom').css({'position': 'static', 'top': '0px'}); 
    } 
}); 

尋找修復頁腳的解決方案。多謝你們。

1

對於固定的頭,你可以給兩個頭這些樣式:

CSS:

.header { 
    position: fixed; 
    width: 100%; 
    z-index: 1; 
} 

我看不到你的頁腳的那一刻?

+0

'.foot-nav {background:#fa4b2a;}'在CSS這是我唯一的腳註。 – Developer

+0

請在foot-nav周圍添加一個頁腳標記 – RasmusGlenvig

+0

添加了'

2

當底部滾動頁腳時,將標題保留在頂部。

設置填充底部爲​​這是您的主要分區。這應該是等同於你footer

JS(jQuery的)的高度:

​​

CSS:

.head-top{ 
    position: fixed; 
    width: 100%; 
    z-index: 999; 
} 

.technology{ 
    overflow:hidden; 
    padding-bottom: 180px; // must be same height as the footer 
} 
.foot-nav { 
    position: relative; 
    margin-top: -180px; 
    height: 180px; 
    clear:both; 
} 
+0

我找到Header Shankat的解決方案,等待頁腳解決方案。 – Developer

+0

@開發者更新... – Sankar

+0

您能否刪除'overflow:auto;'並提供其他解決方案。我不想自動流動。我想表明腳下的死衚衕 – Developer