Giter Club home page Giter Club logo

css3-mediaqueries-js's Introduction

css3-mediaqueries.js - CSS Helper and CSS3 Media Queries Enabler

Author: Wouter van der Graaf

License: MIT

Website: http://code.google.com/p/css3-mediaqueries-js/

Browser support: IE 5+, Firefox 1+ and Safari 2.

Firefox 3.5+, Opera 7+, Safari 3+ and Chrome already offer native support.

Usage:

just include the script in your pages.

(And you should combine and compress with other scripts and include it just before </body> for better page speed - but you already knew that).

Write your media queries like you would for browsers with native support. The script will parse your CSS and apply the styles for positive media query tests realtime (also when you resize).

Note: Doesn't work on @import'ed stylesheets (which you shouldn't use anyway for performance reasons). Also won't listen to the media attribute of the <link> and <style> elements.

####Note: this fork has patches/fixes that are not available in the original Google Code repo

css3-mediaqueries-js's People

Contributors

apinstein avatar catearcher avatar crgwbr avatar dharfr avatar keithpitt avatar livingston avatar mamzellejuu avatar piotaixr avatar pvnr0082t avatar radmike avatar wouterter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css3-mediaqueries-js's Issues

@-moz-document url-prefix() inside of a media query causes error

When you use @-moz-document url-prefix() inside of a media query the script breaks throwing an error:

css-mediaqueries.js, line 4 character 1

Which places the error at the doctype declaration.

@-moz-document url-prefix() can be used outside of a media query without issue.

Tested in IE7&8.

Don't works without "screen" in query

I discovered that "css3-mediaqueries" works only when the query contains "screen".

This query don't works:

@media (max-width: 460px) {
    ...
}

This query works properly:

@media screen and (max-width: 460px) {
    ...
}

patch for <link> support

I added this patch on line 441 to add support for "link" tag

if(link.getAttribute("media").replace(/^\s\s_/, '').replace(/\s\s_$/, '') != ""){ text = "@media " + link.getAttribute("media").replace(/^\s\s_/, '').replace(/\s\s_$/, '') + "{" + text + "}"; }

has not been fully tested, it worked for me, something similar could be added for "style" tag.

Question

As chrome has switched to Blink will it effect the library or has there been updates to make that not an issue, just curious

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.