jquery-johnnys-path

A small jQuery plugin that animates an absolute positioned element according to a path you give.

Usage no npm install needed!

<script type="module">
  import jqueryJohnnysPath from 'https://cdn.skypack.dev/jquery-johnnys-path';
</script>

README

jquery-johnnys-path PayPal Version Downloads Get help on Codementor

A small jQuery plugin that animates an absolute positioned element according to a path you give.

:cloud: Installation

$ npm i --save jquery-johnnys-path

:clipboard: Example

var options = {
    // Animation durations: 500 ms
    d: 500

    // Animation type
  , e: "linear"
};

$("...").johnnysPath(options, [
    { x: 100, y: 0   }
  , { x: 100, y: 100 }
  , { x: 000, y: 100 }
  , { x: 0,   y: 0   }
]);

:memo: Documentation

johnnysPath(options, points, callback)

A small jQuery plugin that animates an absolute positioned element according to a path you give.

Params

  • Object options: An object containing:
    • d (Number): The duration (default: 400 ms)
    • e (String): The animation type (default: "linear")
  • Array points: An array of objects containing the x and y values.
  • Function callback: The callback function.

Return

  • jQuery The selected elements.

:yum: How to contribute

Have an idea? Found a bug? See how to contribute.

:scroll: License

MIT © Ionică Bizău