An es5 vanilla-js implementation of jQuery.marquee
npm i vanilla-marquee
import marquee from 'vanilla-marquee'
new marquee( element, {
options
})https://mattiacoll.github.io/vanilla-marquee-site/
Although this plugin can be a drop in replacment for the jQuery plugin there are some caveats, which may be deal breaking:
allowCss3Supportandeasingoptions have been removed (all animations use the @keyframe implementation)pauseOnCycleoption has been removed, since it was available only whenallowCss3Supportwas set tofalse- no IE and dead browser support, since we are in $currentYear I don't think it's necessary
- this module is not transpiled for old browsers, you can transpile it yourself: example with rollup and babel
babel({
babelHelpers: 'bundled',
exclude: '/node_modules/',
include: [
'src/**', // src folder
/node_modules\/.+(vanilla-marquee|matt-utils)/,
]
}),- the methods can only be called with
instance.method(), in the jQuery version they can be called using$( selector ).marquee( 'methodName' ) - events are fired on the selector rathen than the instance
All the options, methods and events have been moved to the Wiki page
- Install nodeJS: https://nodejs.org
- Switch to the project root directory with the command-line.
- Run
npm installto install dependencies and create the virtual environment.
- Edit source code in the
srcfolder. - Once ready, compile the package with
npm run rl.