Read more

kidcreate / 2008-07-28 14:53:44   

Hi. I am using the script for expanding
my menu items. But i would like to use a similar tool
to allow me to have a 'read more' expanding link on descriptions of my work.
users would click to expand a lengthly description.
any ideas how i could do this?

snoep / 2008-07-28 15:11:57   

I don´t know exactly, but maybe you could try something like this:

1. Write your "longdescription" within a self-created html-tag
2. make it invisible via css
3. create a button with a click-function that hides/shows the tag -> do this with a jquery code that is started on pageload

Maybe this works, if not you could try it with an existing html-tag, that isn´t needed otherwise (for example h5??)

stefan.

LeslieOA / 2008-07-28 15:24:10   

Requires just a little JavaScript knowledge. Assuming your using a default theme and haven't removed any references to jQuery, you could do something like this: -

JavaScript

  1. $('#show_desc').click(function() {
  2.     $('#description').show('slow');
  3.     return false;
  4. });

HTML/XHTML

  1. <span id='show_desc'>Read more</span>
  2. <div id='description'>
  3. This would hold your description text. Hopefully this also gives 
  4. you a rough idea of what you can do with jQuery!
  5. </div>

Good luck!

tomasdiez / 2009-02-08 17:25:03   

Did any one could make it work? I've been trying but I am not advanced in JavaScript. LeslieOA could you please explain me where exactly to put the code? and which other steps are needed? meaning editing css, index.ph, or so on?

thanks!!!

This thread has been closed, thank you.