Questions tagged [modernizr]

Modernizr is an open-source JavaScript library that helps you build the next generation of HTML5 and CSS3-powered websites.

Modernizr is a small JavaScript library that detects the availability of native implementations for next-generation web technologies, most commonly features that stem from the HTML5 and CSS3 specifications. Many of these features are already implemented in at least one major browser (most of them in two or more). Modernizr tells you whether the current browser has this feature natively implemented or not.

The most recent version of Modernizr is Modernizr 2.5, released 6 Feb 2012. More information is available at the Modernizr home page.

When Modernizr v2 was released in June 2011, it made a significant departure from v1 (and from most other common JavaScript libraries): Where version 1 included all the feature detection tests in a single standard script, version 2 allows a site developer to build their own personalized copy of Modernizr that contains only the tests required. This allows a developer to minimize the amount of JavaScript code that their users need to download. However, it also reduces the scope to use a shared content delivery network (CDN) such as Google Code.

902 questions
13
votes
3 answers

Modernizr with cssSandpaper?

i've been struggling for a while trying to have the rotate(xdeg) feature on IE 8 , 7 and 6 , for this i google for a while and found cssSandpaper but since i have to load 4 diferents scripts i want to do it only if its necessary for this im using…
Luis Palacios
  • 754
  • 13
  • 35
12
votes
3 answers

requireJS configuration for Modernizr

I am trying to load the Modernizr feature detects dynamically with requireJS. As Modernizr has built in AMD support this shouldn't be a problem. My requireJS configuration contains the paths to the Modernizr source directory and to the feature…
jantimon
  • 36,840
  • 23
  • 122
  • 185
11
votes
1 answer

Can you detect if Cleartype is enabled on PC via javascript?

Some @font-face fonts don't play nice with non-cleartype settings (gets really choppy on the edges) Is there a way to detect this via javascript so that I can do a modernizr-style class addition to the body if cleartype is off so I can use this in…
dlrust
  • 2,433
  • 19
  • 20
11
votes
1 answer

WebSocket connection to 'ws://./' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

I dont have any knowledge in websockets, i am using a admin template from here https://github.com/onokumus/Bootstrap-Admin-Template i don't know did i do something wrong or how it is giving this problem but i am getting this error in the google…
Sizzling Code
  • 5,932
  • 18
  • 81
  • 138
11
votes
2 answers

Detect different kind of scrollbars (eg. normal / hidden osx)

Using responsive Layout and a lot of CSS to create a Webpage, I am having a problem with scrollbars being hidden or shown and changing the layout by 17px. The main problem is that on OSX the scrollbars hover over the entire Layout without affecting…
11
votes
4 answers

What's the best way to switch between jQuery UI and jQuery Mobile

I want a single site that uses the same HTML but "widgetizes" it in the best way for the platform it's served to. Is there a standard practice for feature detecting mobile devices / hardware keyboards on the client and deciding whether to load…
Sam Hasler
  • 12,344
  • 10
  • 72
  • 106
10
votes
2 answers

LESS CSS syntax useful for modernizr

Usually I use modernizr to find out the browser abilities. Same time, I use LESS CSS to make my css more readable and maintainable. Common style using LESS nested rules looks like this: #header { color: black; .logo { width: 300px; …
Bardt
  • 695
  • 1
  • 8
  • 17
10
votes
3 answers

Angular2 with modernizr

I am learning angular2 and building my own custom components using ng2-bootstrap. I want to use modernizer to detect form input which are natively supported by browser. I am using webpack for building my project.I have successfully configured…
Som
  • 101
  • 1
  • 1
  • 4
10
votes
4 answers

'webkitIndexedDB' is deprecated. Please use 'indexedDB' instead

Does anyone know what this error means? This message started to appear in the Chrome console this week and is throwing an error in jquery modernizr. Doesn't seem to be much helpful info out on the web either.
NealR
  • 10,189
  • 61
  • 159
  • 299
10
votes
6 answers

Modernizr.touch returns true on firefox browser

I have written a peace of code to get the event based on touch and non-touch. Its working all other browsers and devices, but Firefox. Default FF return the true. var thumbsEvent, isTouch = Modernizr.touch; // detect the touch if(isTouch){ …
Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
10
votes
2 answers

Detect browser support for HTML Media Capture

How can I detect browser support for HTML Media Capture* ? The traditional way of testing if an attribute is supported doesn't seem to work on some devices (tested on iPad and Google Nexus): var elm = document.createElement(input); if (capture…
9
votes
2 answers

Should I use Modernizrjs + YepNopejs + Requirejs in the same page?

I'm using RequireJs for structuring my JavaScript code. Also, I'm using a lot of CSS3 and I use "Modernizr w/ YepNope" + x number of css3 polyfills. I understand "Modernizr w/ YepNope" and RequireJs are both Resource Loaders. Since they are both…
Evan Larsen
  • 9,935
  • 4
  • 46
  • 60
9
votes
3 answers

RequireJS conditional dependencies

I'm trying to define a module with conditional dependencies (depending on Modernizr test). I've done something that works but feel hacky to me. Can you tell me what you think and if there is a better way to do it? Thanks. var dependencies =…
karellm
  • 1,843
  • 1
  • 20
  • 23
9
votes
4 answers

Modernizr just for one quick check?

I want to check if the browser who's running my page is capable of handling the 'html 5 placeholder' I know I can add the following javascript check: !Modernizr.input.placeholder but is it worth to import a library just for one check ? also how…
Zo72
  • 14,593
  • 17
  • 71
  • 103
9
votes
4 answers

How to test for nth-child using Modernizr?

I'm trying to use modernizr to test for :nth-child browser support but I'm not sure how to do it, I found this one http://jsfiddle.net/laustdeleuran/3rEVe/ which tests for :last-child but I don't know how to change it to detect :nth-child (I was…
Javier Villanueva
  • 3,886
  • 13
  • 48
  • 80
1 2
3
60 61