Fricking scroll hide show css nightmare!!!

In this example below you will see how to do a Fricking scroll hide show css nightmare!!! with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by ro6er, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright ro6er ©
  • HTML
  • CSS
  • JavaScript
    <h1>Hidden scrollbar</h1>
<p>http://stackoverflow.com/questions/3296644/hiding-the-scrollbar-on-an-html-page</p>
<hr>
<div class="ipn-EventViewNavigationNativeScroller  ">
    <div class="ipn-EventViewNavigationNativeScroller_ContentContainer">
        <h2>Explaination</h2>
        <p>This example hides the scroll bar of the inner div by hiding the outer div's overflow, and by applying a negative margin to <i>pull</i> the scrollbar off of the screen. There's an equal padding applied to the inner div to counter the negative margin so that the content does not get pulled out of the viewport.</p>
        <h2>Lorem Ipsum</h2>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
        <p>Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nulla vitae elit libero, a pharetra augue. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
</div>

/*Downloaded from https://www.codeseek.co/ro6er/fricking-scroll-hide-show-css-nightmare-ORoZdv */
    

$color-yellow: #ffdf1b;
$color-yellow-a1: #a1b936;
$color-yellow-d8: #D8BF22;
$color-yellow-ffe: #FFE640;
$color-green: #14805e;
$color-red-d9: #D92132;
$color-red-d3: #D3545A;
$color-red-9c: #9C2C2C;
$color-red-e0: #E05555;
$color-red-9b: #9b0000;
$color-red-91: #910101;
$color-white: #fff;
$color-white-f0: #f0f0f0;
$color-black: #000;
$color-grey-e8: #e8e8e8;
$color-grey-e4: #e4e4e4;
$color-grey-dd: #ddd;
$color-grey-d8: #d8d8d8;
$color-grey-cc: #ccc;
$color-grey-c7: #c7c7c7;
$color-grey-bb: #bbb;
$color-grey-b5: #b5b5b5;
$color-grey-b6: #b6b6b6;
$color-grey-a7: #a7a7a7;
$color-grey-a9: #a9a9a9;
$color-grey-aa: #aaa;
$color-grey-99: #999;
$color-grey-96: #969696;
$color-grey-88: #888;
$color-grey-8c: #8c8c8c;
$color-grey-70: #707070;
$color-grey-73: #737373;
$color-grey-75: #757575;
$color-grey-77: #777;
$color-grey-66: #666;
$color-grey-61: #616161;
$color-grey-63: #636363;
$color-grey-58: #585858;
$color-grey-59: #595959;
$color-grey-54: #545454;
$color-grey-5e: #5e5e5e;
$color-grey-6e: #6e6e6e;
$color-grey-47: #474747;
$color-grey-44: #444;
$color-grey-41: #414141;
$color-grey-40: #404040;
$color-grey-4d: #4d4d4d;
$color-grey-39: #393939;
$color-grey-33: #333;
$color-grey-30: #303030;
$color-grey-22: #222;
$color-grey-37: #373737;
$color-grey-20: #202020;
$color-grey-3d: #3D3D3D;
$color-green-2b: #2ba37e;
$color-green-d7: #d7e9e3;
$color-green-11: #116b4f;
$color-green-12: #127052;
$color-green-13: #137556;
$color-green-14: #14805e;
$color-green-16: #168c67;
$color-green-18: #189670;
$color-green-66: #66ab98;
$color-green-126: #126E50;
$color-green-28: #288b68;
$color-green-special: #4acfa5;
$color-green-41: #41b590;
$color-green-126: #126e50;
$color-green-54c: #54c7a4;
$color-green-54e: #54e8b9;
$color-green-00: #006a3d;
$color-green-02: #02643a;
$color-blue: #1B3F94;
$color-blue-38: #3857A1;
$color-blue-1b: #1B9A9C;
$color-purple-76: #76257D;
$color-orange-99: #999E00;
















.ipn-EventViewNavigationNativeScroller_ContentContainer {
  overflow: auto;

  /* Make sure the inner div is not larger than the container
  * so that we have room to scroll.
  */
  max-height: 300px;

  /* Pick an arbitrary margin/padding that should be bigger
  * than the max width of all the scroll bars across
  * the devices you are targeting.
  * padding = -margin
  */
  margin-right: -20px;
  transition: margin .1s;
  transition-timing-function: ease-in-out;

  .ipn-EventViewNavigationNativeScroller:hover & {
    margin-right: 0px;
  }
}

.ipn-EventViewNavigationNativeScroller  {
  background-color: tomato;
  // height: 300px;
  position: relative;
  width: 200px;
  overflow-x: scroll;
  overflow-y: hidden;
  transition: width .1s;
  transition-timing-function: ease-in-out;
  &:hover {
    width: 215px;
  }
}


.ipn-EventViewNavigationNativeScroller_ContentContainer {
    &::-webkit-scrollbar-thumb {
        border-radius: 11px;
        background-color: $color-grey-54;
        border-left: 1px solid $color-grey-33;
        border-right: 1px solid $color-grey-33;
        width: 9px;
    }
    &::-webkit-scrollbar-track,
    &::-webkit-scrollbar {
        background-color: $color-grey-33;
        width: 9px;
    }
}




/*Downloaded from https://www.codeseek.co/ro6er/fricking-scroll-hide-show-css-nightmare-ORoZdv */
    

Comments