CSS Media Targeted JavaScript


/ Published in: CSS
Save to your folder(s)

With the ever increasing use of alternate media types I feel there is a need to deliver JavaScript targeted to these types of devices. This would allow alternate and modified content, as well as a customized user experience through the use of modern AJAX techniques.

My goal with this technique is to use CSS to be instructed as to what type of media device is being used, and deliver that information onto the JavaScript which could then in turn run CSS media targeted code. To accomplish this, we will use a div set to display:none with an id of "mediaInspector", to hold a "variable" passed from CSS to JavaScript:

URL: http://www.ibloomstudios.com/articles/css_media_targeted_javascript/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.