Installation

How to get the JS.Responsive library and choosing the right installation for your project.


Step 1 - get the lib

You have several possibilities here. Download via download page or

npm install JS.Responsive
or
bower install JS.Responsive

In bower and npm you get default build and full build prepared in dist folder. But you can build own version following this steps:

  • run npm command to download dependencies
  • npm install
  • to build default (JS.Responsive.js) and full build (JS.Responsive.full.js = all features included)
  • npm run build
  • to build your custom build edit JSON config file in `server/customBuild.json`
  • ["isScrolling", "detectTouch"]
  • each string represent name of a feature, full list of available features is in `server/featuresList.json`
  • when customBuild.json is ready run custom build command
  • npm run custom
  • build will finish with statement in console
  • Custom build DONE!
  • output built files are in `dist/` directory (`JS.Responsive.custom.js`, `JS.Responsive.custom.min.js`, etc..)




Step 2 - include into your project

Include lib into HEAD element in your document:

 <script type="text/javascript" src="path/to/scripts/JS.Responsive.js"></script>

Or include it as UMD component

import JSResponsive from ('JS.Responsive');
var JSResponsive = require('JS.Responsive');




Step 3 - init lib in js

Library needs to be initialised - it is for your better control

JS.Responsive.init();

you can init modules individually refer to documentation