jQuery if, else, with media query

In some case, you need to have a jQuery function only at a specific site width, for example, if you want to add a margin dynamically to the site-header only at a specific media query. You can use jQuery for this, this snippet for example, fire the jQuery function only if the browser width is more than 950px.