I'm trying to add arrows to the x
and y
axes of the scrollbar, here's my scrollbar: http://jsfiddle.net/Nk3NH/
And I want this arrow(image) for the two axes: http://i.imgur.com/ygGobeC.png
I'm looking for the code that add the arrows like that and not up and down.
I wanted to do the same thing, but without having to use background-images for the arrows. My solution is to use overlapping background gradients:
::-webkit-scrollbar-button:vertical:start:decrement {
background:
linear-gradient(120deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(240deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(0deg, #696969 30%, rgba(0, 0, 0, 0) 31%);
background-color: #b6b6b6;
}
::-webkit-scrollbar-button:vertical:end:increment {
background:
linear-gradient(300deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(60deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(180deg, #696969 30%, rgba(0, 0, 0, 0) 31%);
background-color: #b6b6b6;
}
::-webkit-scrollbar-button:horizontal:end:increment {
background:
linear-gradient(210deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(330deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(90deg, #696969 30%, rgba(0, 0, 0, 0) 31%);
background-color: #b6b6b6;
}
::-webkit-scrollbar-button:horizontal:start:decrement {
background:
linear-gradient(30deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(150deg, #696969 40%, rgba(0, 0, 0, 0) 41%),
linear-gradient(270deg, #696969 30%, rgba(0, 0, 0, 0) 31%);
background-color: #b6b6b6;
}
I've been playing around with it for you.
First I set the buttons to be 10px x 10px to make it easier, and created 4 10 by 10 arrows pointing left, right, up and down.
Then I set the background-size to be 100%, to scale it correctly.
Then i set the correct image to each button using, the :increment
, :decrement
, :horizontal
and :vertical
selectors.
The images are on my public dropbox right now, but you can add your own.
Here's the updated code: http://jsfiddle.net/Nk3NH/2/
the code I wrote was this:
::-webkit-scrollbar-button {
background-size: 100%;
height: 10px;
width: 10px;
-webkit-box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}
::-webkit-scrollbar-button:horizontal:increment {
background-image: url(https://dl.dropboxusercontent.com/u/55165267/icon2.png);
}
::-webkit-scrollbar-button:horizontal:decrement {
background-image: url(https://dl.dropboxusercontent.com/u/55165267/icon4.png);
}
::-webkit-scrollbar-button:vertical:increment {
background-image: url(https://dl.dropboxusercontent.com/u/55165267/icon3.png);
}
::-webkit-scrollbar-button:vertical:decrement {
background-image: url(https://dl.dropboxusercontent.com/u/55165267/icon.png);
}
EDIT: Managed to get the scroll buttons next to each other as OP wanted by adding these styles:
::-webkit-scrollbar-button:end {
display: block;
}
::-webkit-scrollbar-button:start {
display: none;
}
http://jsfiddle.net/Nk3NH/4/
Updated code with base64 images instead of broken links:
http://jsfiddle.net/burkybang/1z7vgfpt/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With