Open webmasterpf opened 4 years ago
Hi,
I've installed enquire .js in my project with:
$ npm install enquire.js + enquire.js@2.1.6
but nothing happen, so I would to know how to enable enquire.js for a drupal project ?
In Drupal8 there is many files that manage JS, I think libraries.yml could be the good one, but I can put the import command in a js file as well.
Is this the right command ? import enquire from "enquire.js";
import enquire from "enquire.js";
To test it I done this:
jQuery(document).ready(function () { ////***** ENQUIRE.JS ****///// var desktop = "screen and (min-width:1200px)";// sortie=>> min-width: XXXpx xlarge 1200px var desktopwide = "screen and (min-width:1440px) and (min-resolution:1dppx)"; //Utilisation d'enquire.js enquire.register(desktop, { match : function() { console.log('Enquire.js : BP pour:'desktop); //Video sur HP /*$(".acces_rubriques iframe").each(function () { $(this).removeAttr('width'); $(this).removeAttr('height'); $(this).removeAttr('align'); });*/ $(".acces_rubriques iframe").height('95vh').width('60vw');//Video Gde Taille HP }, unmatch : function() { example.unmatch(); } });//enquire.register(desktop) });//Fin document.ready
Thanks for help
Hi,
I've installed enquire .js in my project with:
but nothing happen, so I would to know how to enable enquire.js for a drupal project ?
In Drupal8 there is many files that manage JS, I think libraries.yml could be the good one, but I can put the import command in a js file as well.
Is this the right command ?
import enquire from "enquire.js";
To test it I done this:
Thanks for help