• autox420

    (@autox420)


    I want to have a button in the title which can hide the post content completely.
    The whole post content div needs to be hidden.
    Post per post.

    + show post div content
    – hide post div content

    I have tryied to put show hide scripts direclty into the index.php but it hides all post content div.

    Need a work around or somcind of plugin.

    Example: https://i.imgur.com/XIDmnY0.png

    Does anyone know any solution for this?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The answer is theme dependent, but generally speaking, you only want to hide the entry content div that is a immediate sibling element of the article parent container element which contains the the button that was clicked. It’s easier to implement this in jQuery, but plain JS is possible. If you get the object clicked on, walk the DOM back to the common container of both the button and the entry content div you want to hide. Then reverse walk forward to get to the child entry content container. Once you have the right container, toggle its visible style attribute to back and forth to hide and show it.

    If you use the correct jQuery selectors, walking the DOM should be quite simple.

Viewing 1 replies (of 1 total)
  • The topic ‘Show hide post div content BUTTON in title’ is closed to new replies.