Limit command
Limit the number of entries in a list or the number of characters in a string.
Basic Usage (HTML)
data-jkit="[limit:count=10]"
Advanced Init (JavaScript)
$('#myelement').jKit('limit', { 'count': '10' });
Options
Option | Values | Default | Description |
---|---|---|---|
elements | “chars” or “children” | children | Which elements to limit, DOM childrens or characters in a string? |
count | Int | 5 | Limit to this amount of elements |
animation | “fade”, “slide” or “none” | node | The type of animation used for the transition |
speed | Int or “fast”, “slow” (Milliseconds) | 250 | The duration of the animation in milliseconds, bigger = slower. |
easing | String (“linear” or easing plugin option) | linear | The easing behavior of the animation |
endstring | String | … | Text to add at the end if chars are limited |
Events
Event | Description |
---|---|
complete | Triggered after all elements are removed |
Examples
List limit:
Limit the amount of entries in a list:
- Entry 1
- Entry 2
- Entry 3
- Entry 4
Source:
<ul data-jkit="[limit:count=3]"> <li>Entry 1</li> <li>Entry 2</li> <li>Entry 3</li> <li>Entry 4</li> </ul>
String limit:
Limit a string to 25 characters:
Source:
<span data-jkit="[limit:elements=chars;count=25]">1234567890123456789012345678901234567890123456789</span>
Replacements
There are currently no replacements for this command.
[ Learn more about replacements ]
Discussions
Do you have questions or do you want to suggest new features? Than head over to our new community:
[ jKit Community ]