2016-02-14 106 views
0

首先嗨。我開始前臺一個月,所以我是初學者。我想在滾動條下滑時進行固定菜單。我這樣做。但是如果我上升,效果延遲3s & 4s。我看不到問題。感謝您的幫助:)。Jquery效果延遲了固定菜單

Html code: 

<div id="header"> 
    <div id="navbar"> 
    <div id="logo"> 
     <a href="anasayfa.html"><img src="resimler/3.png" /></a> 
    </div> 

    <div id="menu1"> 
     <ul> 
     <li class="onecıkar"> <a href="kisiselilan.html"> Kisisel İlan Ver </a> </li> 
     <li class="onecıkar"> <a href="firmakaydet.html"> Firma Kaydet </a> </li> 
     <li class="ozel"> <a href="kurumsalilanver.html"> Kurumsal İlan Ver </a> </li> 
     <li class="ozel" id="menu2"> <a href="iletisim.html"> İletisim </a> </li> 
     </ul> 
    </div> 

    </div> 

    <div id="menubar"><img src="resimler/menu46.png" /> </div> 

    <div id="kayıt"> 
    <form class="kadi"> 
     <p class="yazı"> Kullanıcı Adı <span> : </span> </p> 
     <input type="text" name="Kullanici_Id" class="kkadi" /> 
     <br> 
     <br> 

     <p class="yazı" id="sifre"> Sifre <span>: </span> </p> 
     <input type="password" class="kkadi" name="Password" /> 

     <br> 

     <p id="pass"><a href="#"> Sifremi Unuttum </a></p> 
     <br> 

     <input class="altbtn" id="giris" type="submit" value="Giriş" /> 
     <input class="altbtn" id="kayıtol" type="submit" value="Kayıt Ol" /> 

    </form> 
    </div> 

</div> 

CSS和jQuery在這裏:

https://jsfiddle.net/carnvall/7yfg784c/2/

回答

0

你可以做的是使整個菜單上的使用CSS: 試試這個:

`div#navbar { 
    margin-left: 100px; 
    position:fixed; 
    top:0; 
    left: 0; 
} 

`