0
Example在這個網站上你可以看到左邊有一個「follow us,facebook」。如何使用jquery/css修復屏幕上的元素(有例子)?
當您向上或向下滑動屏幕時,它會跟隨屏幕。
我不知道如何實現這個或有任何存在的jquery插件來做這樣的功能?謝謝
Example在這個網站上你可以看到左邊有一個「follow us,facebook」。如何使用jquery/css修復屏幕上的元素(有例子)?
當您向上或向下滑動屏幕時,它會跟隨屏幕。
我不知道如何實現這個或有任何存在的jquery插件來做這樣的功能?謝謝
#myElement {
position:fixed;
top:50px;
left:0px;
}
元素將被相對於瀏覽器窗口中定位和滾動/調整大小不會影響它
您只需要使用作爲position:fixed;
一些造型器的位置。你也可以使用css規則,下面是一個例子。
聯樣式
<div style="position:fixed; top:100px; left:0px;">
your content
</div>
用css
<html>
<style>
#element {
position:fixed; top:100px; left:0px;
}
</style>
<body>
<div id="element">
your content
</div>
</body>
</html>
不好的做法,把造型中的HTML代碼。 – Konst
使用CSS還添加了代碼 –
內聯樣式也是CSS,順便說一下 –