I am building a responsive website in which I use css3 media queries to detect the width in ems of the browser. For example:
<link href="/css/tablet-desktop.css" rel="stylesheet" media="all and (min-width: 33.236em)">
However I would like to disable certain JQuery functions for certain widths. For example I may want to disable an image magnifier for a product page when viewed on a mobile device. I may also want to disable the jQuery UI tabs function so the tabs collapse on top of each other when on a mobile device.
Is there a way to detect the width in ems of a browser in jQuery then use this to disable some jQuery functions?
Incidentally I do use modernizr but could not find any suitable functions to help me.
Ok I have found a complete working solution. First of all thanks to Neil_Bradley for the window width tip. I combined this with the plug-in to calculate the ems:
The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.
Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will receive an overview of the basics of CSS showing inline styles.
In the head tags set up your style tags:
Reference the nav tag and set your properties.: (CODE)
Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles.
Reference your jQuery libraries:
Include your new external js/jQuery file:
Write your first lines of code to setup your site for jQuery…