javascript - Scroll to the right in element with fixed width and hidden overflow -
I have set up an example that has a fixed-width element with hidden overflow, which scrolls to the right.
HTML css JS I think what you are trying to achieve, but the other problem For, you can leave the original element Depending on the stirring elements in your entire project, you may be able to remove the parent element. Depending on the basic element, you can use position full for the status of your element (I have removed the parent element in the following demo so that the situation Relative to the viewport). CSS Demo 1: CSS Demo 2: & lt; div class = "nowrap" & gt; & Lt; div class = "inner" & gt; Start larger container, fixed width, only one line, scrolls ending when overflow, -------------------------> END & lt; / Div & gt; & Lt; / Div & gt;
body {font-size: 1em; } .nowrap {white-space: nowrap; Hidden flurry; Width: 40 AM; }
$ (function () {var $ nowrap = $ ('. nowrap'); var $ inner = $ ('internal. '); Var width = $ inner.width (); $ nowrap.scrollLeft (width);});
My question:
.nowrap {white-space: nowrap; Hidden flurry; Width: 40 AM; Swim left; }. {Float: right; } HTML Demo 2:
& lt; Div class = "inner" & gt; START Large container, fixed width, only one line, scroll to end if overflow occurs, -------------------------> End & lt; / Div & gt;
.inner {Status: Completed; Correct: 50%; White-space: Abrop; }
Comments
Post a Comment