Giter Site home page Giter Site logo

marcopazzanese / readmore.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jedfoster/readmore.js

0.0 2.0 0.0 112 KB

A lightweight jQuery plugin for collapsing and expanding long blocks of text with "Read more" and "Close" links.

Home Page: http://jedfoster.github.com/Readmore.js/

readmore.js's Introduction

Readmore.js

A smooth, lightweight jQuery plugin for collapsing and expanding long blocks of text with "Read more" and "Close" links.

The required markup for Readmore.js is also extremely lightweight and very simple. No need for complicated sets of divs or hardcoded class names, just call .readmore() on the element containing your block of text and Readmore.js takes care of the rest.

Example

$('article').readmore();

Yes, it's that simple. You can change the speed of the animation, the height of the collapsed block, and the open and close elements.

$('article').readmore({
  speed: 75,
  maxHeight: 500
});

The options:

  • speed: 100 (in milliseconds)
  • maxHeight: 200 (in pixels)
  • moreLink: '<a href="#">Read more</a>'
  • lessLink: '<a href="#">Close</a>'

If the element has a max-height CSS property, Readmore.js will use that value rather than the value of the maxHeight option.

readmore.js's People

Contributors

jedfoster avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.