Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:11:54+00:00 2026-06-15T10:11:54+00:00

Trying to create a ‘read more/read less’ function to an article (see below for

  • 0

Trying to create a ‘read more/read less’ function to an article (see below for code). The code I’m using is exactly what I need… however, I’m unable to add an image for both the more and less portion of this function. When it’s at the ‘Read More’ position it should be an down arrow. And when at the ‘Read Less’ position it should have the up arrow.

How would I be able to accomplish this?

$(document).ready(function() {

// The height of the content block when it's not expanded
var adjustheight = 80;
// The "more" link text
var moreText = "More";
// The "less" link text
var lessText = "Less";

// Sets the .more-block div to the specified height and hides any content that overflows
$(".more-less .more-block").css('height', adjustheight).css('overflow', 'hidden');

// The section added to the bottom of the "more-less" div
$(".more-less").append('<a href="#" class="adjust is-more"></a>');

$("a.adjust").text(moreText);

$(".adjust").toggle(function() {
    $(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible');
    $(this).text(lessText);
  }, function() {
    $(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden');
    $(this).text(moreText);
});

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:11:55+00:00Added an answer on June 15, 2026 at 10:11 am
    $("a.adjust").addClass('more-text').text(moreText);    
    $(".adjust").toggle(function() {
        $(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible');
        $(this).addClass('less-text').removeClass('more-text').text(lessText);
      }, function() {
        $(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden');
        $(this).addClass('more-text').removeClass('less-text').text(moreText);
    });
    

    And now style css classes .more-text and .less-text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying create a xmldocument object by a different XML see the code
hi I'm trying create chat using node.js I see example in http://chat.nodejs.org/ I have
I trying create a responsive site and need see where is page break in
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
All, I am trying create a 'to & fro' animation using jquery animate &
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying create a gui using Tkinter that grabs a username and password and
I'm trying create this function such that if any key besides any of the
I'm trying create a gantt chart with highcharts and I need to put the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.