jquery - How can i split the text into two columns in same length using javascript? -
i have used code of below reference link reading simulation.
https://jsfiddle.net/g9zsa86n/
i have created box using <div id="sim"></div>
. working good, have situated change 2 columns in same length.
q1: how split text 2 columns?
q2: , reading cursor travel down column on left, down column on right.
for example:
if have entered around 100 words box, shows first 2 lines in first column, next 2 lines in 2nd column. after read these 4 lines, cursor should travel next 2 lines of 1st column, next 2 lines of 2nd column autoscroll-x, autoscroll-y.
if possible change, me?
you can css 3. multi column layout module defines column-count. set 2 , a1. split div in 2 , a2. have cursor behave expected.
https://jsfiddle.net/g9zsa86n/3/
#sim{ column-count: 2; -moz-column-count: 2; -webkit-column-count: 2; }
it's well supported across browsers. if use compass write css, maintainable.
ps , humble.rumble commented, support ye olde browsers can fallback modernizer shim.
Comments
Post a Comment