Auto Break Long Headline To New Line - PrettyBreak

Auto Break Long Headline To New Line - PrettyBreak
File Size: 2.75 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

PrettyBreak is a smart and responsive word-wrap plugin to create neat headlines that automatically break long text into new lines for better readability.

See also:

How to use it:

1. Download and import the jquery.pretty-break.js script in the document.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="jquery.pretty-break.js"></script>

2. Just attach the plugin prettyBreak to the long text block and done.

<p class="demo">
  Morbi sed imperdiet augue. Vestibulum magna tortor, condimentum sed iaculis ac, luctus sit amet urna. Quisque auctor, mi nec consequat tristique, mi erat placerat lorem, convallis rutrum metus mi quis metus. Nulla facilisi. Sed tempus euismod placerat. Vestibulum ut eros volutpat, pellentesque enim at, dignissim ex. In condimentum eu turpis consectetur imperdiet. Nulla volutpat ultrices nulla, vel cursus metus feugiat in. Duis augue lacus, eleifend eget volutpat sed, malesuada in ipsum. Morbi nec sagittis lectus. Cras ac ex blandit, condimentum arcu eu, cursus lacus. Pellentesque imperdiet urna et nulla elementum, ut dignissim odio cursus. Fusce ultricies dictum arcu quis pharetra. Praesent a mauris eleifend, efficitur dui at, bibendum felis.
</p>
$(function(){
  $('.demo').prettyBreak();
});

Changelog:

2019-09-10

  • Update jquery.pretty-break.js

This awesome jQuery plugin is developed by SumoSoft. For more Advanced Usages, please check the demo page or visit the official website.