ok。サイドバーに問題があります。私は左のサイドバーを固定して、「こんにちは、世界?サイドバーはスティッキーのように上がります。私はプラグインを使いたくない。私はいくつかの短いコードが必要です。それはそのためだけのものです。 jsfiddleで私を助けてください。 CSSでのID bar-fixed
のために使用position: fixed;
スクロールのようにスクロールするときにサイドバーを固定する方法
*/i want use javascript.../
#header { clear:both; width: 100%; background-color: darkorange; border-top: 1px solid #d2d2d3; border-bottom: 1px solid #d2d2d3; margin: 20px 0px 20px 0px;}
h1.head {font-family: verdana; font-size: 200%;}
a { color: orange;}
.sidebar { float: left; width: 25%; height: 100%;}
#text { float: left; width: 70%;}
body { text-align:center;}
p, p a {text-align: left; font-size: 90%;}
<body>
<div id="header">
\t <h1 class="head"><b>Hello, world ?</b></h1>
</div>
<div id="bar-fixed">
\t <div class="sidebar">
\t \t <p class="bar"><a href="#">
\t \t Make this fixed when scroll</a></p>
\t \t <p class="bar"><a href="#">
\t \t Make this fixed when scroll</a></p>
\t \t <p class="bar"><a href="#">
\t \t Make this fixed when scroll</a></p>
\t \t <p class="bar"><a href="#">
\t \t Make this fixed when scroll</a></p>
\t \t <p class="bar"><a href="#">
\t \t Make this fixed when scroll</a></p>
\t </div>
</div>
<div id="text">
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
<p>I want the sidebar fixed when i scroll down over the Header. and the sidebar will go up LIKE STICKY SIDEBAR</p>
</div>
</body>
ない..私はそれを使用している場合。サイドバーの上部にスペースがあります。 –
はい、正しく入力してください。サイドバーを配置するには、他のスタイルを使用する必要があります。もしあなたが望めば、私は見せることができます。 –
あなたの最後の答えを編集してみましょう –