marcj / css-element-queries

CSS Element-Queries aka Container Queries. High-speed element dimension/media queries in valid css.
http://marcj.github.io/css-element-queries/
MIT License
4.27k stars 487 forks source link

ResizeSensor throws error when called #192

Closed om-nishu-trantor closed 6 years ago

om-nishu-trantor commented 7 years ago

I simply included this script in my html file, and then tried to call

new ResizeSensor(jQuery('#my-container'), function(){ 
    console.log('content dimension changed');
});

It throws

Uncaught TypeError: ResizeSensor is not a constructor

I am sure there is another way to initialise/call the constructor. Can someone put that out here, should be updated in docs/demo as well

marcj commented 6 years ago

Because you haven't included the ResizeSensor.js in your html. Download the files in this repo and use it with <script src="src/ResizeSensor.js"></script> before you execute your new REsizeSensor code.