2

This is my HTML:

<div class="photo-thumbnails">
    <div class="horizontal-scroll">
      {{#each photos}}
        <div class="inline">
          <a class="photo-link-{{../_id}}" href="{{src_big}}" data-imagelightbox="b" id="#imagelightbox">
            <img class="img-thumbnail {{../_id}}" src="{{src}}">
          </a> 
        </div>    
      {{/each}}
    </div>
  </div>

And this is CSS:

.photo-thumbnails {
}

.horizontal-scroll {
  overflow-x: auto;
  white-space: nowrap;
}

.inline {
  display: inline-block;
}

How can I hide horizontal scrollbar while being able to scroll?

4
  • stackoverflow.com/questions/16670931/… Commented Mar 10, 2015 at 8:05
  • @tony.gustafsson did not help Commented Mar 10, 2015 at 8:29
  • Which browser are you using? Commented Mar 10, 2015 at 8:47
  • Google Chrome, notice that I need to hide horizontal scroller Commented Mar 10, 2015 at 9:07

1 Answer 1

1

You need to create an outer div which is less tall than the inner div.

.inner {
    position: absolute;
    width: 300px;
    overflow: scroll;
}

.inner p {
    width: 1000px;
}

.outer {
    display: block;
    position: relative;
    width: 300px;
    height: 110px;
    overflow: hidden;
}

Here is an jsfiddle example

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.