Lightweight Text Scrambling JavaScript Plugin – scramble.js

Category: Animation , Javascript , Text | March 19, 2018
Author: Recidvst
Views Total: 495
Official Page: Go to website
Last Update: March 19, 2018
License: MIT

Preview:

Lightweight Text Scrambling JavaScript Plugin – scramble.js

Description:

scramble.js is a lightweight, standalone JavaScript plugin to reveal text with a random scrambling effect.

How to use it:

Add the ‘data-scrambler’ attribute to the target text.

<p data-scrambler>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mi sem, convallis id elit vel, efficitur tincidunt eros. Sed iaculis lectus at lacus faucibus, nec ultricies arcu hendrerit. Quisque vehicula iaculis imperdiet. Donec sagittis iaculis eros ac dapibus. Quisque facilisis commodo nisi, a aliquet nunc varius vitae. Ut porttitor sed justo vel fringilla. Cras lacinia gravida orci. Nam neque diam, egestas nec feugiat non, aliquet id lorem. Pellentesque malesuada iaculis arcu, sed pharetra nisl luctus vitae. In hac habitasse platea dictumst. Quisque turpis purus, tristique quis ligula ut, condimentum tempus libero. Vivamus eget eros id magna hendrerit semper. In blandit ipsum non est fermentum, non pretium nulla fermentum. Proin nec justo id erat rhoncus ultrices.
</p>

Add the main JavaScript file ‘scramble.js’ to the bottom of the webpage.

<script src="js/scramble.js"></script>

That’s it. The plugin will automatically scramble the text on page load. You can also create a button to trigger the text scrambling effect manually.

<button id="scramble-button"> Scramble it</button>

Leave a Reply