Post pobrano z: Truncating HTML With JavaScript Without Losing Markup – Cutter.js
We sometimes need to display a shorter version of a text/content so that it fits to the layout as expected (like the "read more" links shown for truncated content).
Cutter.js is a JavaScript class that allows us to accomplish this on the client-side without losing markup.
The class cuts the content to the number of requested words and if needed puts a link to open the full content again and, if wanted, places a link to open the full content.
It is a standalone + lightweight resource (1.5kb gzipped) and works cross-browser.
Special Downloads:
Ajaxed Add-To-Basket Scenarios With jQuery And PHP
Free Admin Template For Web Applications
jQuery Dynamic Drag’n Drop
ScheduledTweets
Advertisements:
Professional XHTML Admin Template ($15 Discount With The Code: WRD.)
Psd to Xhtml
SSLmatic – Cheap SSL Certificates (from $19.99/year)
