Skip to content

jameswestgate/mediaQuery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mediaQuery

Plug-in for jQuery that adds a class to each selected element equal to the key of any matching media query. Also acts as a polyfill for media queries, matchMedia and addEventListener javascript functions.

Usage:

$(document).ready(function(){
	
	$('body').mediaQuery({
		w320: 'only screen and (min-width: 320px)',
		w480: 'only screen and (min-width: 480px) ',
		w768: 'only screen and (min-width: 768px)',
		w1024: 'only screen and (min-width: 1024px)'
	});
})

Example:

http://jameswestgate.github.com/mediaQuery/examples/

About

Cross browser query plug-in for jQuery. Add classes to the dom based on media queries.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors