2
可以滾動表現得像一個固定的元素。我想滾動覆蓋內容的元素,而不是移動其全部寬度。當盒子有overflow: hidden
和:hover
更改爲overflow
到auto
時,會出現問題。懸停滾動和文字跳躍
JSBin爲了更好地理解這個問題 https://jsbin.com/gurijinugo/edit?html,css,output
的我使用jQuery
可以滾動表現得像一個固定的元素。我想滾動覆蓋內容的元素,而不是移動其全部寬度。當盒子有overflow: hidden
和:hover
更改爲overflow
到auto
時,會出現問題。懸停滾動和文字跳躍
JSBin爲了更好地理解這個問題 https://jsbin.com/gurijinugo/edit?html,css,output
的我使用jQuery
我解決了這個問題不感興趣的解決方案。我不使用@DaniP添加的評論解決方案,因爲我的問題更復雜。如果有人遇到類似問題,我添加了一個解決方案。我添加了一個包裝div
,其中有position: absolute;
和固定width
。 爲了更好的理解JSBin: https://jsbin.com/mogavegule/edit?html,css,output
但javascript會好嗎? – Roberrrt
是的,在JavaScript中的獨奏會很好:) –
https://jsbin.com/nawolefupu/1/edit?html,css,output ....那麼保存滾動條的空間就像這樣 – DaniP