I've spent days trying to get enquire.js to work for me; maybe what I'm trying to get enquire.js to do isn't possible.
I'm trying to load 3 external js source files depending on the media query width. I've uploaded enquire.js v2.1.2, and added it to the head and have verified that it is loading. What I'm wanting it to is this:
<script>
enquire.register("screen and (max-width: 599px)", {
match : function() {
loadJS('http://www.externalwebsite.xxx/propgallery/slider/52662?rows=2&columns=1&auto=false');
}
});
enquire.register("screen and (min-width: 600px) and (max-width: 899px)", {
match : function() {
loadJS('http://www.externalwebsite.xxx/propgallery/slider/52662?rows=2&columns=2&auto=false');
}
});
enquire.register("screen and (min-width: 900px)", {
match : function() {
loadJS('http://www.externalwebsite.xxx/propgallery/slider/52662?rows=2&columns=3&auto=false');
}
});
</script>
Is it possible to achieve this using enquire.js? Should I be putting a declaration in the besides calling the enquire.js?