Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <section>
- <article>
- <h3>title<h3>
- <div>paragraph to be wrapped</div>
- <a class="readmore">Read more</a>
- </article>
- <article>
- <h3>title<h3>
- <div>paragraph to be wrapped</div>
- <a class="readmore">Read more</a>
- </article>
- </section>
- $('article').each(function(){
- $(this).find('div').dotdotdot({after: '.readmore'})
- });
- $('.readmore').click(function(){
- //first I want to target the div right above the clicked .readmore link
- var targetedDiv = $(event.target).parent().children('div');
- // Then I try to get the div's original content through the dotdotdot function
- var targetedDivHTML = targetedDiv.triggerHandler('originalContent');
- });
- $('article').each(function(){
- $(this).find('div').dotdotdot({after: '.readmore'})
- $(this).click(function(){
- var content = $(this).find('div').triggerHandler('originalContent');
- $('.fulltextdiv').append(content);
- $('.fulltextdiv').show();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement