modernizr

CSS3 animation-fill-mode polyfill

血红的双手。 提交于 2019-11-30 11:34:50
Preface Let's pretend that a div is animated from opacity:0; to opacity:1; and i want to keep opacity:1; after the animation ends. That's what animation-fill-mode:forwards; does. @keyframes myAnimation { from { opacity:0; } to { opacity:1; } } div { opacity:0; animation-name:myAnimation; animation-delay:1s; animation-duration:2s; animation-fill-mode:forwards; }​ <div>just a test</div>​ Run it on jsFiddle Note 1: i didn't include the vendor prefixes here to simplify Note 2: that's just an example, please don't reply with "just use jQuery fadeIn function" etc. Some things to know In this answer

How to detect if Media Queries are present using Modernizr

大憨熊 提交于 2019-11-30 11:14:38
I'm trying to detect whether media queries are present using Modernizr 2, then loading in respond.js if appropriate. I've put this in my script.js file... Modernizr.load({ test: Modernizr.mq, yep : '', nope: 'mylibs/respond.js' }); What am I doing wrong? I'm really surprised there isn't an example of how to do this with Media Queries on the Modernizr site. Here is the version of Modernizr I'm using... http://www.modernizr.com/download/#-backgroundsize-borderradius-boxshadow-iepp-respond-mq-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load That's because !!Modernizr.mq ===

HTML5 input validation doesn't work in IE8

核能气质少年 提交于 2019-11-30 07:16:32
问题 Hello kind people of the internet, I've been hacking at this for a while...and have seen several similar postings, but I can't seem to figure this out: The HTML5 input field validation CSS works in Firefox, Chrome...but alas, not in IE8...and much of my target audience will be using IE8. ...and yes: I'm using Modernizr, and I used Initializr to get the page template and CSS...I'm a bit confused why I can't get things working properly in IE8. Here's a link to my test page: Test html5 page The

html5 form validation modernizr safari

不羁岁月 提交于 2019-11-30 05:20:16
问题 this is the working example: http://jsfiddle.net/trustweb/sTSMW/ i notice an errore using safari 5.05 if i set a form as in an html5 page and i repleace the functionality with jquery if modernizr fail the test: Modernizr.inputtypes.email && Modernizr.input.required && Modernizr.input.placeholder with other browsers (firefox, chrome and opera) the browser validate the form in ie jquery replace the validation function in safari it dosen't work, modernizr seems to return true while testing html5

Modernizr Causes Content Security Policy (CSP) Violation Errors

那年仲夏 提交于 2019-11-30 01:56:11
I am attempting to use the new Content Security Policy (CSP) HTTP headers on a test site. When I use CSP in conjunction with Modernizr I get CSP violation errors. This is the CSP policy I am using: Content-Security-Policy: default-src 'self'; script-src 'self' ajax.googleapis.com ajax.aspnetcdn.com; style-src 'self'; img-src 'self'; font-src 'self'; report-uri /WebResource.axd?cspReport=true These are the errors from the Chrome browser console: Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline'

What is causing my scripts to be requested twice while using Modernizr.load (yepnope.js)

泄露秘密 提交于 2019-11-30 00:34:01
问题 I am using yepnope.js to load javascript files dynamically,and I've noticed that my scripts appear to be loaded twice according to Firebug and Webkit Inspector. The problem is that in Firebug's Net panel (Firefox 4 latest), their response is a 200 , not a 304 . It seems to be slower than in Chrome. I have uploaded this video showing the issue. You can see how the files jquery-1.6.1.min.js and libs.js are loaded an extra time. The code I am using to do this is the following, simplified:

Modernizr Media query doesn’t work when resize browser

六月ゝ 毕业季﹏ 提交于 2019-11-29 20:59:03
问题 I use a Modernizr media query in JavaScript to change an element margin and add a class "small". My Modernizr media query doesn't work when I resize my browser, but when I refresh the page then it works. I know I can solve this problem using the jQuery $( window ).resize() function, but I want to solve it using a media query. Can any one tell me how I can solve this problem? <html class="no-js"> <head> <title>Foundation 5</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2

Are Modern browsers loading scripts parallel or sequentially?

让人想犯罪 __ 提交于 2019-11-29 11:46:03
问题 I'm evaluating existing resources for script loading optimization, but I readed in some articles like this, refers to the older browsers block other downloads until this sequential script loading phase is completed. I check Modernizr(yepnope.js), headjs and ControlJs as candidates. But, is it necesary use this tools for parallel script loading in modern browsers? 回答1: I believe by default most browsers today will actually load the scripts in parallel; but the browser will not by default

Detecting html5 audio support with Modernizr

点点圈 提交于 2019-11-29 07:32:46
Is it possible to detect if the browser has Html5 Audio support through Modernizr? If so how is this done? If not are there any work around's? There's few resources on Google explaining this, so any help would be appreciated. Yes, through modernizr.audio. It supports a number of audio formats (currently ogg, mp3, m4a & wmv). Example: var audio = new Audio(); audio.src = Modernizr.audio.ogg ? 'background.ogg' : Modernizr.audio.mp3 ? 'background.mp3' : 'background.m4a'; audio.play(); More info in the documentation . Yes, Modernizr detects audio support, according to the documentation (that's a

Support 'background-size' property on older browsers?

房东的猫 提交于 2019-11-29 04:21:25
Is there a way that I can use the CSS3 'Background-Size' property and then use something like Modernizr to ensure that it's supported in older browsers (in particular I want to use 'background-size: cover' option)? I took a look at cssFx, which is mentioned from the Modernizr website, but this only seems to add vendor prefixes for browsers which need them to use a property, rather than allowing browsers such as IE8 to support the background size property. Also looked at CSS3Pie, but that doesn't seem to currently support the background-size property. [11/10/2011 - By older browsers I'm