1.0.4 • Published 11 months ago

adaptive-swapper v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
11 months ago

adaptive-swapper

Simple changing the position of elements (tags) depends on the width of the window.

npm.io

Demo

https://webdeveloper.pro/demo/adaptive-swapper/demo.html

Check first

Perhaps you can use CSS. For example GRID.

Install

  1. Install jQuery

  2. Install adaptive-swapper

    Git

    npm install https://github.com/mavlutovr/adaptive-swapper.git --save

    Npm

    npm install adaptive-swapper --save

Setup

import adaptiveSwapper from 'adaptive-swapper';

Usage

adaptiveSwapper({

    // The position of the elements for the width 960 or less of the window
    960: {

        // Header
        '#js-mobile-header': [
            '*', // Already existing any element in #js-mobile-header
            '#js-header-cart',
            '#js-callback-button'
        ],

        // Menu
        '#js-mobile-menu': [
            '#js-search-form'
        ]
    },

    // The position of the elements for the width 480 or less of the window
    480: {

        // Header
        '#js-mobile-header': [
            '*',
            '#js-header-cart'
        ],

        // Menu
        '#js-mobile-menu': [
            '#js-search-form',
            
            // Moved from #js-mobile-header
            '#js-callback-button'
        ]
    }

});

License

MIT License

1.0.4

11 months ago

1.0.3

11 months ago

1.0.1

3 years ago

1.0.0

3 years ago