├── demo.html ├── readme.md ├── responsive-containers.min.js ├── src └── responsive-containers.js ├── test ├── index.html └── tests.js └── tools └── closure ├── compile.sh └── compiler.jar /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |The two menus below both have identical HTML but are presented differently depending on their current width. At a 'typical' browser width and font size the menu in the smaller column simply lists the links. In the larger column it displays extra images and lays out the options in a grid.
93 |This is achieved with a small piece of JavaScript, which is activated by the code shown below.
94 |<ul class="my-list" data-squery="min-width:30em=wide">
Adding the data-squery
attribute above causes a class value of wide
to be added to the element when it is wider than 30 ems, and extra CSS is applied to the element based on that class value.
Currently you can use em
or px
units.
Content here
8 |