Skip to content

Commit 53b57c1

Browse files
author
Mr_Green
committed
modified
1 parent 1418c71 commit 53b57c1

File tree

2 files changed

+60
-22
lines changed

2 files changed

+60
-22
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,13 @@ Some of the styles in the above css are necessary to let the scroll work.
7171
}
7272
</script>
7373

74+
###How I got this thought:
75+
76+
I got this thought, when I found solution to hide the default scrollbar (_using css_) which was the requirement for a post on [Stackoverflow](http://stackoverflow.com/a/16671476/1577396).
77+
78+
The solution was simple but that is how I got this thought :).
79+
80+
---------------------------------
81+
7482
If you find any issues, please file them in issues section.
7583

resources/slimscroll.css

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,86 @@
1+
/* custom stylesheet */
2+
.wrapper.mac + .scrollBarContainer{
3+
background-color: transparent;
4+
}
5+
.scrollBarContainer.animate .scrollBar{
6+
transition: 2s opacity ease;
7+
opacity: 0;
8+
}
9+
.scrollBarContainer:hover .scrollBar{
10+
opacity: 0.5;
11+
transition: none;
12+
}
13+
.unselectable {
14+
-webkit-user-select: none;
15+
-khtml-user-select: none;
16+
-moz-user-select: -moz-none;
17+
-o-user-select: none;
18+
user-select: none;
19+
}
20+
/* end of custom stylesheet */
21+
22+
/******************************************************/
23+
/**************** important ***************************/
24+
/******************************************************/
25+
26+
/* slim scroll attached stylesheet */
127
.contentHolder {
28+
/* custom css here */
29+
border: 1px solid #CCC;
30+
margin-top: 20px;
31+
/* end of custom css */
32+
/* slim scroll necessary css properties */
233
display: inline-block;
3-
line-height: 15px;
434
overflow: hidden;
535
position: relative;
636
height: 200px;
737
width: 380px;
8-
border: 1px solid #CCC;
9-
margin-top: 20px;
38+
/* end of slim scroll necessary css properties */
39+
/* [end] don't override the above properties here */
1040
}
1141
.wrapper {
42+
/* custom css here */
43+
padding: 5px;
44+
/* end of custom css */
45+
/* slim scroll necessary css properties */
1246
overflow: auto;
1347
position: absolute;
1448
left: 0px;
1549
top: 0px;
1650
right: -18px;
1751
bottom: 0px;
18-
padding: 5px;
1952
padding-right: 3px;
53+
/* end of slim scroll necessary css properties */
54+
/* [end] don't override the above properties here */
2055
}
2156
.scrollBarContainer{
57+
/* custom css here */
2258
background-color: #E1E1E1;
59+
/* end of custom css */
60+
/* slim scroll necessary css properties */
2361
position: absolute;
2462
top: 0px;
2563
bottom: 0px;
2664
right: 0px;
2765
width: 5px;
2866
cursor: pointer;
67+
/* end of slim scroll necessary css properties */
68+
/* [end] don't override the above properties here */
2969
}
3070
.scrollBar {
71+
/* custom css here */
3172
background-color: #999999;
73+
/* end of custom css */
74+
/* slim scroll necessary css properties */
3275
border-radius: 10px;
3376
opacity: 0.5;
3477
position: absolute;
3578
right: 0px;
3679
left: 0px;
3780
top: 0px;
81+
/* end of slim scroll necessary css properties */
82+
/* [end] don't override the above properties here */
3883
}
39-
.wrapper.mac + .scrollBarContainer{
40-
background-color: transparent;
41-
}
42-
.scrollBarContainer.animate .scrollBar{
43-
transition: 2s opacity ease;
44-
opacity: 0;
45-
}
46-
.scrollBarContainer:hover .scrollBar{
47-
opacity: 0.5;
48-
transition: none;
49-
}
50-
.unselectable {
51-
-webkit-user-select: none;
52-
-khtml-user-select: none;
53-
-moz-user-select: -moz-none;
54-
-o-user-select: none;
55-
user-select: none;
56-
}
84+
85+
/* end of slimscroll attached stylesheet */
86+
/* [Note]: I suggest to add this important stylesheet below of all stylesheets in your html file */

0 commit comments

Comments
 (0)