I agree with another post that the anti-aliasing plugin is not designed for this. Itβs actually quite easy to write something that does a great job of it. For example, wrapping hidden text in <span class="truncated"> :
<p> This is the visible part <span class="truncated">this is the hidden part.</span> </p>
Then hide it, add the hide / show icon and switch the state:
$('.truncated').hide() // Hide the text initially .after('<i class="icon-plus-sign"></i>') // Create toggle button .next().on('click', function(){ // Attach behavior $(this).toggleClass('icon-minus-sign') // Swap the icon .prev().toggle(); // Hide/show the text });
This takes precedence over the icon-minus-sign class over icon-plus-sign , but you can add a switch to it for both if it makes you feel more secure.
Demo: http://jsfiddle.net/VNdmZ/4/
source share