Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable enquire.js for a drupal project #174

Open
webmasterpf opened this issue Dec 2, 2019 · 0 comments
Open

How to enable enquire.js for a drupal project #174

webmasterpf opened this issue Dec 2, 2019 · 0 comments

Comments

@webmasterpf
Copy link

webmasterpf commented Dec 2, 2019

Hi,

I've installed enquire .js in my project with:

$ npm install enquire.js
+ [email protected]

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:

  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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant