I have a custom plugin ( from dotdotdot plugin) used in my paragraph tag to make it ellipses if it overflows.
//ellipsis
$(".custom").dotdotdot({
/* The HTML to add as ellipsis. */
ellipsis : '...',
/* Wrap-option fallback to 'letter' for long words */
fallbackToLetter: true,
/* Optionally set a max-height, if null, the height will be measured. */
height : 40,
});
Here is my HTML
<div class="mainWrapper">
<div class="drop">
<p class="custom">
Sub Division Title Sub Division Title Sub Division Title
</p>
</div>
</div>
<a class="myBUtton"> click me</a>
For my project I have to append that .custom paragraph by clicking .myBUtton. I used
$('.mainWrapper').on('click', '.myBUtton', function() {
$(".drop").append('<p class="custom">Sub Division Title Sub Division Title Sub Division Title</p>');
});
But if I append that paragraph with append method .dotdotdot function not working. without appending it's working but don't know why it's not working after append. Is there proper way to do that. May be I am doing wrong or missing anything. Any help will be appreciated.
Thanks