1

I am working on a page with horizontal scrolling and multiple columns. The first column of the text should be centered on the page and the other columns should be visible, too. Here is a sketch, which demonstrates what I have right now – an article with columns which is scrollable: jsfiddle. I would like to see the overflow text, too. I know overflow-y:visible and overflow-y:scroll cannot be combined, but how can achive something similar?

Only the text (article) should be scrollable, not the whole page.

Here are some images which illustrate what I would like to do:

image 1 – starting position image 2 – while scrolling image 3 – scroll end position

Pwdr
  • 3,712
  • 4
  • 28
  • 38
  • you cannot combine those two, one will trigger auto to the other one. Beside, you look for visible and scroll for the same direction , aren't you ? – G-Cyrillus Jun 15 '14 at 14:42
  • I know, that I cannot combine these two, but I am looking for something which produces a similar result – scroll with visible overflow. – Pwdr Jun 15 '14 at 14:46

1 Answers1

1

Not too sure of what you are looking for, but here is a hint with display and text-indent:

DEMO

CSS to demonstrate idea :

.article-wrapper {
  border:solid;
  width:600px;
  margin:auto;
  text-indent:0;
  transition:1s
}
.article-wrapper:hover {
  text-indent:-500px;;
}
article {
  text-indent:0;
  display:inline-block;
  height:400px;
  width:500px;
  column-width:500px;
}

If this effect wanted, you may look for a way via transition, animation or javaScript to take control over it.

G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
  • This will not work, because I have multiple (more than two) columns and the scrolling should be done manually. But the idea with text-indent is interesting. – Pwdr Jun 15 '14 at 14:48
  • 1
    @Pwdr If you combine pointer-events and bigger text-indent maybe this gives a bit more ideas : http://codepen.io/gc-nomade/pen/KJEic , here what you can do (with image but can be columns) and a bit more efficient http://codepen.io/gc-nomade/pen/ActpB you need to retrieve width from javascript to set text-indent value or margin or translate , whatever is the technic you want to support – G-Cyrillus Jun 15 '14 at 14:57
  • Thanks for your help! Your idea with `text-indent` led me to `padding` – this basically does what I want, the only problem is, that the last column cannot be scrolled to the starting position (the last image in first post), so `padding-right` seems not to be working there. [new jsFiddle](http://jsfiddle.net/LSHjQ/1/) – Pwdr Jun 15 '14 at 15:09
  • @Pwdr as i suggested you need to retrive width of element in order to get it's width and set the proper value to the negative text-indent (or margin...) . check this where scrollwidth of ul is used and not width :) http://codepen.io/gc-nomade/pen/KJzLD notice the way to update/insert the rule . – G-Cyrillus Jun 15 '14 at 16:41