Nathan
Nathan

Reputation: 41

How would one detect if scrollbar styling is supported using jQuery 1.9?

See usually I'd just use:

$.browser.webkit 

Since we all know webkit is the only one which lets you style the scrollbar. However that's been removed in 1.9 in favour of:

$.support

Which is all fine and dandy except I'm pretty sure you can't check for scrollbar styling support this way. If you can, please let me know, or I'm just going to downgrade back to 1.8 again. The only reason I want to do this is because I'd rather use a built in system a browser has available rather than a javascript solution to style the scrollbar.

Upvotes: 3

Views: 1105

Answers (1)

Ruan Mendes
Ruan Mendes

Reputation: 92274

Since KevinVB didn't make an answer out of his comment...

There is no way do detect what that scroll-bar styling is supported with any jQuery built in method. Also, you shouldn't just be looking for webkit browsers, IE and Opera also support it in a different way.

Modernizr is the most complete feature detection tool out there, and there's a plugin for detecting styling of scroll-bars. You can use it like the following

if (Modernizr.cssscrollbar) {  ... }

Upvotes: 4

Related Questions