Retina, Script and Style Loader - Conditionizr

Retina, Script and Style Loader - Conditionizr
File Size: 8.46 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Conditionizr is an intelligent jQuery plugin which can detect the visitor's browser and pixel ratio, allowing you to serve specific conditional JavaScript and CSS files they need.

How to use it:

1. Include jQuery library and Conditionizr.js

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="js/conditionizr.min.js"></script>

2. Call the function

<script>
$(function() {
$('head').conditionizr({
debug      : true,
scriptSrc  : 'js/conditionizr/',
styleSrc   : 'css/conditionizr/',
ieLessThan : { active: false, version: '9', scripts: false, styles: false, class: true, customScript: 'none'},
chrome     : { scripts: false, styles: false, class: true, customScript: 'none' },
safari     : { scripts: false, styles: false, class: true, customScript: 'none' },
opera      : { scripts: false, styles: false, class: true, customScript: 'none' },
firefox    : { scripts: false, styles: false, class: true, customScript: 'none' },
ie10       : { scripts: false, styles: false, class: true, customScript: 'none' },
ie9        : { scripts: false, styles: false, class: true, customScript: 'none' },
ie8        : { scripts: false, styles: false, class: true, customScript: 'none' },
ie7        : { scripts: false, styles: false, class: true, customScript: 'none' },
ie6        : { scripts: false, styles: false, class: true, customScript: 'none' },
retina     : { scripts: false, styles: false, class: true, customScript: 'none' },
mac    : true,
win    : true,
x11    : true,
linux  : true
});
});
</script>

This awesome jQuery plugin is developed by unknown. For more Advanced Usages, please check the demo page or visit the official website.