Maca
Maca

Reputation: 1689

Need help on text expander jQuery plugin

I am trying to use this text expander/collapse jQuery plugin to only display first snippets of text, but if I load this in the page the whole text would show up first and then when the plugin is fully loaded in to the browser it would collapse down(I could visually see this process). Is there any technique that you can teach me so that only collapsed text would display first?

Here is the plugin I am trying to use: http://plugins.learningjquery.com/expander/demo/index.html

Upvotes: 0

Views: 820

Answers (1)

Tin Can
Tin Can

Reputation: 2870

You could put some css into the paragraph type you're collapsing, and hide it when it hasn't been collapsed

    <p id="textblock" style="display:none">

then use jQuery to show it right after your plugin collapses it

    $("textblock").show()

Upvotes: 2

Related Questions