jamesflorentino / nanoScrollerJS

A jQuery plugin that offers a simplistic way of implementing Lion OS scrollbars.
http://jamesflorentino.github.com/nanoScrollerJS/
MIT License
2.69k stars 502 forks source link

Left side scrollbar different style sample #239

Open aydnahmet opened 10 years ago

aydnahmet commented 10 years ago

I needed left side scrollbar for a projects page and i changed the css file. You can look it from this link.

http://ahmet-aydin.net/nanosample/index.html

CCS File


/** initial setup **/
.nano {
  position : relative;
  width    : 100%;
  height   : 100%;
  overflow : hidden;
}
.nano > .nano-content {
  position      : absolute;
  overflow      : scroll;
  overflow-x    : hidden;
  top           : 0;
  right         : 0;
  bottom        : 0;
  left          : 0;
}
.nano > .nano-content:focus {
  outline: thin dotted;
}
.nano > .nano-content::-webkit-scrollbar {
  visibility: hidden;
}
.has-scrollbar > .nano-content::-webkit-scrollbar {
  visibility: visible;
}
.nano > .nano-pane {
  background : rgba(0,0,0,1);
  position   : absolute;
  width      : 1px;
  left      : 10px;
  top        : 10px;
  bottom     : 0;
  visibility : hidden\9; /* Target only IE7 and IE8 with this hack */
  opacity    : .01;
  -webkit-transition    : .2s;
  -moz-transition       : .2s;
  -o-transition         : .2s;
  transition            : .2s;
  /*-moz-border-radius    : 5px;
  -webkit-border-radius : 5px;
  border-radius         : 5px;*/
}
.nano > .nano-pane > .nano-slider {
  background: #444;
  background: rgba(0,0,0,1);
  position              : relative;
  margin                : -10px -10px;
  /*-moz-border-radius    : 3px;
  -webkit-border-radius : 3px;
  border-radius         : 3px;*/
}
.nano:hover > .nano-pane, .nano-pane.active, .nano-pane.flashed {
  visibility : visible\9; /* Target only IE7 and IE8 with this hack */
  opacity    : 0.99;
}

HTML File

 <div style="height: 190px; width: 600px;">
        <div id="about" class="nano">
            <div class="nano-content">
                <div style="margin-left: 30px;">
                    <b>The standard Lorem Ipsum passage, used since the 1500s</b><br />
                    <br />
                    "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."<br />
                    Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC<br />
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".nano").nanoScroller({ sliderMaxHeight: 15 });
        });
    </script>