DZone
Web Dev Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Web Dev Zone > Javascript onMediaQuery - A Neat Way To Trigger JavaScript When Media Queries Change

Javascript onMediaQuery - A Neat Way To Trigger JavaScript When Media Queries Change

Hirvesh Munogee user avatar by
Hirvesh Munogee
·
May. 24, 12 · Web Dev Zone · Interview
Like (0)
Save
Tweet
4.75K Views

Join the DZone community and get the full member experience.

Join For Free
javascript onmediaquery is a neat way to trigger js when media queries change.  jeremy keith recently posted a fantastic way of getting css and javascript to talk media queries with the css :after pseudo-property.  this has a number of advantages over using window.matchmedia(), namely that you only have to maintain your breakpoints in one place, and it fails more gracefully.

requirements : none
demo : https:/ / github. com/ joshbarr/ js-media-queries
license : mit license
Media queries JavaScript Database Media (communication)

Published at DZone with permission of Hirvesh Munogee, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Password Authentication. How to Correctly Do It.
  • Stupid Things Orgs Do That Kill Productivity w/ Netflix, FloSports & Refactoring.club
  • How To Integrate Event Streaming Into Your Applications
  • How to Upload/Download a File To and From the Server

Comments

Web Dev Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo