Click here to Skip to main content
15,905,607 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have div it that i have provided height with 80px and provide anchor link as Read More.

Here i have maintained 10 records perpage.
when i click on next page the dot dot dot style has destroyed and not applied style for readmore anchor list.
Could you please help me how to maintain dot dot dot.
View code

HTML
<<div class="expert-summary">>
      
      
                                        @Model.Summary data
                                        <<a href="#" class="readMoreLink">>Read More<</a>>
                                    <</div>>


Js Code

function hideLinkIfNoTruncation(isTruncated, origContent) {
            if (!isTruncated) {
                $('.readMoreLink', this).remove();
            }
            
        }

        function clicked() {
            var div = $(this).closest('.expert-summary');
            div.trigger('destroy').find('.readMoreLink').remove();
            div.height('auto');
            return false;
        }

        $(document).ready(function () {
            $(".expert-summary").dotdotdot({
                after: "a.readMoreLink",
                callback: hideLinkIfNoTruncation
            });

            $('a.readMoreLink').on('click', clicked);
        });


Not maintain styles until end of the pagination
Posted
Updated 31-Jan-16 22:02pm
v4

1 solution

I am implementing by using the below url which they have implemented.
Edit fiddle - JSFiddle[^]
It is working fine but when i click on next page in pagination the styles are not applied for collapse the text in div.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900