Adding Ellipsis after a number of characters...
Hi there,
Im a newby in Jquery, and Im whiling to learn more about it!
By now, im having a problem with a text box which I need to show and hide a part of the content, but inserting the Elippsis when the part is hidden!
bellow the html and script codes!
Any help plz?
- function toggle_guru(id, anchor) {
var b = $(id);
if(b.hasClass('guru'))
{
b.animate({ "height": "210px" }, 500);
$(anchor).html('read more');
b.removeClass('guru');
}
else
{
b.animate({ "height": '340px' }, 500);
$(anchor).html('read less');
b.addClass('guru');
}
}
- <div class="add_opinion_content">
Sells a wide range of entertainment products online. A 101cd.com voucher code allows you to make even bigger savings on the already great prices. You ca Sells a wide range of entertainment products online. A 101cd.com voucher code allows you to make even bigger savings on the already great prices. You can choose from Sells a wide range of entertainment products online. A 101cd.com voucher code allows you to make even bigger savings on the already great prices. You can choose from choose!!
</div>
<a id="read_more" class="guru" onClick="toggle_guru('.add_opinion_content','#read_more');">read more </a>