I'm trying to find a jQuery scrollbar that looks like the one of the iPhone: a simple black bar without the up or down buttons. I've found a few scripts but most tend to do so much more than I need. I basically have a div with a fixed height that is set on overflow:auto to which I would like to apply this scrollbar. Help would greatly be appreciated!
Matteo Spinelli has an iPhone-like scrollbar inside of his iScroll library. You should try looking into whether or not you can adopt it to your needs.
What are your browser requirements?
You should try to avoid javascript solutions since they will increase the complexity of your page. If a third-party scrollbar javascript library breaks, you will have to debug it yourself (been there, done that).
Chrome has full support for CSS3 scrollbars, something like this should make an iPhone like scrollbar
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
IE allows styling scrollbars with vendor specific tags, but its very limited. e.g.:
scrollbar-base-color: #663366;
scrollbar-face-color: #99CCCC;
scrollbar-track-color: #996699;
scrollbar-arrow-color: #330033;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #CCCCCC;
scrollbar-shadow-color: #663366;
scrollbar-darkshadow-color: #000000;
Here is a jsFiddle with the styled scrollbars:
http://jsfiddle.net/APmLZ/3/
Related
I am generating a list of organisations of the left hand side of this page: http://www.ihhub.org/member-map/
This list is generated through appending <span> tags that are linked to the corresponding map.
My issue is - the scroll bar does not appear in CHROME but does appear in Firefox and Safari.
Any solutions?
UPDATE:
This issue appears to be isolated to MAC OS.
SOLUTION:
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
According to CSS - Overflow: Scroll; - Always show vertical scroll bar?: OSx Lion hides scrollbars while not in use to make it seem more "slick", but at the same time the issue you addressed comes up: people sometimes cannot see whether a div has a scroll feature or not.
CSS fix:
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(0,0,0,.5);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
I am seeing scroll bar well. If you are using Mac, you may want to make sure that scrollbars are always shown
Add this to your css
.list::-webkit-scrollbar {
-webkit-appearance: scrollbartrack-vertical;
}
or
.list::-webkit-scrollbar {
-webkit-appearance: scrollbarthumb-vertical;
}
I am using Windows 8 and Google Chrome version is 48.0.2564.97. And its working perfect. See in image highlighted area.
I am using Crome Version 48.0.2564.97 m
And it is working just fine..
Change it to overflow-y:auto in case if there are not enough items it will not show scroll.
I am actually making a website where the main browser is Internet Explorer 10.
They set the website so the Navigation Mode is set to compatibility IE10. (you can see this when you press F12, the info are on the bottom)
So I don't want to switch to the Navigator mode IE10, because they made an interface already, and if I change it, it just goes weird.
So Im going to explain you what I tried to get my rounded border to work ... They work half of the time.
So first I tried border-radius, but no succes with it.
So I then look for a plugin on the internet to find a way to make some rounded border and I found CSS3PIE.
This is like a JS plugin that can make the rounded border.
Like I said, it work half of the time.
So my css with this pluggin look likes this:
width:100px;
padding:20px;
top:0px;
position:relative;
vertical-align:top;
border:1px solid black;
-webkit-border-radius: 4px 4px 4px 4px;
-moz-border-radius:4px 4px 4px 4px;
border-radius:4px 4px 4px 4px;
-webkit-box-shadow: 0px 0px 2px rgb(0, 0, 0);
-moz-box-shadow: 0px 0px 2px rgb(0, 0, 0);
box-shadow: 0px 0px 2px rgb(0, 0, 0);
behavior: url(http://blablabla/Pie2/PIE.htc) ;
So as you can see, I just need to add up the file to the css and it do everything automaticly.
The probleme I have right now, is when I load the page for the first times, everything loads correctly(the borders), but when I switch between tabs on the website, sometimes the borders appears, and some other time they just wont appear.
When they are not appeard, I need to mouse over the element to make them appear.
(I guess that's a function that they have in their JS)
That thing is really annoying and that's what I want to fix :)
I want my border to always be there when I switch tabs!
If you have any other solution, feel free to inform me about them!
Thanks for any help!
__________>
Thanks, they want to stay with IE10. Do you know any other apps like CSS3PIE that I could try to see if I get any difference?
You can put this on the <head> section of your website:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
This will disable the Compatibility mode and stop messing your site.
i tried to set border radius to a td element, but it isn't work on IE7 and IE8
i tried all possible solutions but it still not working
here's my css classs :
padding: 5 5 5 5;
background-color: gray;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0 0 5px 5px #888;
-webkit-box-shadow: 0 0 5px 5px#888;
box-shadow: 0 0 5px 5px #888;
zoom: 1;
filter: alpha(opacity=70);
opacity: 0.7;
behavior: url(../Bin/PIE.htc);
i tried to use PIE.js and it also not working.
IE7 and IE8 don't support CSS3 rounded corners. You will need to look to other IE specific solutions if you want to emulate this.
How to create rounded corners in ie 8 and < is one method using .htc controls for IE.
I need to add that no solution to your problem I have ever found is 100% they all have drawbacks and can never have the full functionality that CSS3 offers.
I am trying to get a dropshadow effect going on selected HTML elements (input text, select, div etc).
The solutions given by many internet users were using CSS3 solution where it uses:
-moz-box-shadow
-webkit-box-shadow
box-shadow
However, this will not work on IE8 (possibly other IE versions)
Is there any way of creating this effect without using these CSS3 elements?
use this css for ie-8
.shadow
{
width:300px;
height:200px;
background-color:red;
filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=145, Strength=3)
}
I am not quite sure how it can be done without CSS3 but what I know is
.shadow {
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
}
will work in all browsers.
use CSS3 pie for a ridiculously cross-browser solution.
So what I need is simple: user presses something, user sees a shadow effect on new div (div centered window) on top of all page (with 1/4 size for example) alike
Is it possible with some pure web-kit css art? Or javascript+images combination is needed? And how to do such thing?
What you are looking for can be called a modal window. It can be done using CSS3 properties, but it is supported only in IE9+, Firefox 4, Chrome, and Opera.
For a cross-browser solution, you should look at javascript scripts which can render the same effect. There are many popular packages like Lightbox, ShadowBox, ThickBox, FaceBox, etc.
If you are using ASP.NET, there is the ModalPopupExtender in the AJAXToolkit, which will give you the effect.
You need two things a div for your dialog box with box-shadow and another div that lies behind your dialog box with an opacity of 50% or so. This can be done with some css in most every browser including ie. Read this article on how to get box-shadow work in all browser: http://robertnyman.com/2010/03/16/drop-shadow-with-css-for-all-web-browsers/
so your html will look like this:
<div class="overlay"/>
<div class="dialogbox">someContent</div>
and your css:
.overlay {
position:absolute;
height: 100%;
width: 100%;
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;
/* Safari 1.x */
-khtml-opacity: 0.5;
opacity: 0.5;
}
.dialogbox{
width: 200px;
height: 150px;
margin: auto;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
}
From this quote:
Web-kit css div shadow: is it possible
to put it onto div with pure css
and this one:
user sees a shadow effect on new div
It seems as though you're asking if it's possible to create the "shadow" effect around the inner div using CSS.
Chrome's settings page is using CSS3's box-shadow to do this:
-webkit-box-shadow: 0 5px 80px #505050;
box-shadow works in these browsers: http://caniuse.com/css-boxshadow
and the cross-browser CSS is:
-webkit-box-shadow: 0 5px 80px #505050;
-moz-box-shadow: 0 5px 80px #505050;
box-shadow: 0 5px 80px #505050;
http://jsfiddle.net/XHAbV/
If you need it to work in older versions of IE, you can use CSS3 PIE to emulate the box-shadow in those browsers.
If you're after the JavaScript side of how to do this (a modal window), the other answer covers it quite thoroughly.