ThemeShaper Forums » Thematic

[closed]

hide/reveal text between ID's within a page

(5 posts)
  • Started 12 years ago by zorro
  • Latest reply from kwight
  • This topic is not resolved
  1. zorro
    Member

    Hell all.

    1st post.

    I am trying to work out how to reveal text underneath a heading when (preferably) an arrow next to said heading is clicked.
    So, for example, I have a client's health site that has a program helping mothers go through the various stages of pregnancy.

    The program is divided into cycles.

    I want to list the cycles. Every time someone clicks on a triangle next to one of the cycles, the description of said cycle is revealed. Click on the triangle again and it is hidden.

    All of this within a single page

    The test site is visible here (http://www.thesmellys.com/marc/programs/conception-to-delivery-and-beyond/) It is a page. Site is very much a work in progress.

    I looked high and low but only seem to be able to find this function in relation to menus (as opposed to inline content.) i have never used Javascript (if that is necessary) within wordpress content.

    Cheers,

    T

    Posted 12 years ago #
  2. this isn't really a thematic issue outright. you're gonna need to get your feet into some jquery.

    http://api.jquery.com/slideDown/
    http://api.jquery.com/slideUp/

    there is a .click example that will probably be useful.

    see my thread here: http://forums.themeshaper.com/topic/jquery-in-thematic-demystified
    on how to initialize scripts.

    you won't need step 2b as these don't require jquery plugins, but step 2a (switching to google's jquery) is a decent idea for speed.

    Posted 12 years ago #
  3. kwight
    Member

    Combining .slideUp() and .slideDown() is also easily done with .slideToggle():

    http://api.jquery.com/slideToggle/

    You can create a shortcode for inserting the necessary code in to your content, and then use jQuery for the toggle effect.

    Posted 12 years ago #
  4. clever, clever. i like that. do you have a good tut on how to create shortcodes? i've copied one or two before, but have more i'd like to make. OT, but any chance you have a shortcode that makes lists?

    Posted 12 years ago #
  5. kwight
    Member

    This tut was really helpful:

    http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right-way/

    As for lists, I'm not sure a shortcode would be easier to users than learning
    <ul> and <li>... Shortcodes get unwieldly and ugly very quickly if there are numerous elements involved.

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.