Diokuz / baron

Native scroll with custom scrollbar
MIT License
776 stars 124 forks source link

Base structure #172

Open rustam87 opened 6 years ago

rustam87 commented 6 years ago

Man, please create base structure of baron and add to tutorial. I have been workiing with baron already two hours and dont understanding how it works. For example HTML

<div class="baron">
        <div class="baron__scroller"></div>
</div>

bla bla bla CSS

.baron{}
.baron_scroller{}

bla bla bla

only rules that real needing for initialize baron

JS

baron({
   scroller: ''
});

only options that real needing for initialize baron

Thanks

Safe-Mode commented 6 years ago

Same stuff for me)

rustam87 commented 6 years ago

HTML

 <div id="baron_1" class="baron baron__root baron__clipper _simple">
  <div class="baron__scroller">
      // Your content
  </div>
  <div class="baron__track">
          <div class="baron__bar"></div>
  </div>
 </div>

CSS you need @import "~baron/skins/styles.css" and select one of 3 classes(for example baron__clipper _simple like this) and your element(in this example element with id=#baron_1 must have a height, for example 300px

JS

baron({
     scroller: `#baron_1`,
     track: `.baron__track`,
     bar: `.baron__bar`
});