1.3.7 • Published 4 years ago

@mrbakieness/npm_masonary v1.3.7

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Masonry CSS & JS

Masonry

Install

npm install @mrbakieness/npm_masonary --save-dev

Useage

To use the module first you have to import the module into your main JavaScript file.

import '../node_modules/@mrbakieness/npm_masonary/main.js';

Example

Once the module has been imported use the follwing to turn a container and its child elements to a masonry layout.

masonary('.container', '.items'); 

Advanceed Example

There are a few options that can be used to customise the masonry layout they are the following:

OptionDescriptionDefault
columnsNumber of columns the layout should use at max screen size.4
marginMargin for each element, so the layout is even. In pixels15
max_widthmaximum width of the layout. In pixels1200

To use these options use the following code.

masonary('.container', '.items', {
    columns: 6,
    margin: 20,
    max_width: 1000
});

Not all options have to be used, you can pick and choose which one or two you want.

To set just a custom margin:

masonary('.container', '.items', {
    margin: 20,
});

To make a 6 column layout with a max width of 1000px but use the default margin property:

masonary('.container', '.items', {
    columns: 6,
    max_width: 1000
});
1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.0

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago