Controls

Adding Properties

To enable the Recommends functionality on any section, add the readMore property to the section configuration.

(window.readmo = window.readmo || []).push({
  section: '12345',
  container: '#readmo-12345'
  readMore: true
});

Or you can customize the Recommends implementation like this:

(window.readmo = window.readmo || []).push({
  section: '12345',
  container: '#readmo-12345'
  readMore: {
    speed: 500,
    previewHeight: 450,
    buttonHtml: '<div>My Custom</div>',
    buttonText: 'Continue Reading',
    onLoad: function(){},
    beforeExpand: function(){},
    afterExpand: function(){}
  }
});

Properties

Property

Description

Type

Required

speed

Expanding animation speed in milliseconds.

number

No

previewHeight

Height in pixels to clip the article.

number

No

buttonText

Used to specify custom text on the button.

string

No

buttonHtml

Custom html string template to render for the button.”

string

No

onLoad

Event fired once the Read More rendering is complete.

function

No

beforeExpand

Event fired before expanding the article to full height.

function

No

afterExpand

Event fired after the article has been expanded.

function

No


Once enabled, the parent container height will be restricted to the previewHeight defined. If the container height is less than the specified previewHeight, the Read More button is not rendered.