• Resolved rodmusic

    (@rodmusic)


    Hi Baden,

    This plugin is amazing, but I am greedy and want to do more! Is there a way to combine scrollonclose with a collapseall? I want to have a collapseall at the bottom of a long page, and have it cause the page to scroll back to the top.

    You can see why here: http://fgmea.org/docs

    I’ve temporarily created an account for you to access the page.
    username: twinpictures password: houseboat

    Go to the page, click “Open All Folders”, scroll to the bottom, and click “Close All Folders”. The problem will be obvious. Perhaps this was explained in the documentation, but I couldn’t figure it out.

    Thanks,
    Rod

    https://wordpress.org/plugins/jquery-collapse-o-matic/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter rodmusic

    (@rodmusic)

    OK, as soon as I posted my question, I got an idea. Using the same login info, you can see the result here: http://fgmea.org/test

    For anybody interested, here’s how I did it:

    1. Placed <a id="openall"></a> near the top of the page. I experimented with the exact location to get what I wanted.
    2. Inserted <a href="#openall" class="expandall">Open All Folders</a> wherever I wanted a link for expanding everything.
    3. Inserted <a href="#" class="collapseall">Close All Folders</a> wherever I wanted a link for collapsing everything.

    Since I used the id rather than the name attribute, it should be HTML5-friendly, but I’m not certain of that. I would be happier, if it would scroll smoothly rather than JUMP, but it works and it was simple.

    hi.
    to scroll smoothly you can define it with css, probably or use this: http://manos.malihu.gr/page-scroll-to-id/.

    you can also use the findme attribute :http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/

    bye

    Thread Starter rodmusic

    (@rodmusic)

    Thanks, m.a.r.c.o, but that plugin made my site freeze. I tried it several times and couldn’t get it to work. I’m not sure how to define it in CSS myself.

    The findme attribute works with the [expand] shortcode. Not sure how to use it with HTML tags. Anu suggestions?

    Thread Starter rodmusic

    (@rodmusic)

    I tried a different plugin for smooth scrolling:
    http://wordpress.org/support/plugin/easy-smooth-scroll-links

    It didn’t make things freeze, and it scrolls smoothly to my anchors, but it disables the expandall and collapseall functions. That defeats the main purpose, of course. The individual folders will still open and close as before. You can see it here: http://fgmea.org/test

    I will keep working on it, but would appreciate any more ideas!

    Plugin Author Baden

    (@baden03)

    Hello rodmusic,
    First, you might want to use a <span> instead of <a> tags for your collapse/expand elements. There might be some conflict with using anchor (a) tags and find-me / scrolling features.

    You might want to also check out the toggle feature of Collapse-Pro-Matic, that allows you to expand/collapse all with one trigger.

    In the meantime, we will do some testing with using both scroll-on-close and collapse/expand all and get back to you.

    Thread Starter rodmusic

    (@rodmusic)

    Hi Baden,

    Using the <span> makes the anchor not work. I will mess with it some more later today and upgrade to Collapse-Pro-Matic, too.

    Here’s how I’ve been doing it, which works if I turn off the Easy Smooth Scroll Links plugin, but then I lose smooth scrolling.

    Here’s my anchor:

    And how I get to it:
    <span style="margin-left: -15px; font-size: small; font-weight: bold;"><a href="#openclose" class="expandall"><img style="vertical-align: -30%; margin-right: 2px;" src="http://fgmea.org/images/folder-open.png" height="16" />Open All Folders</a> <a href="#openclose" class="collapseall"><img style="vertical-align: -30%; margin-right: 2px;" src="http://fgmea.org/images/folder-closed.png" height="16" />Close All Folders</a></span>

    Thread Starter rodmusic

    (@rodmusic)

    Thread Starter rodmusic

    (@rodmusic)

    Here’s what I have now, getting there, no scroll plugin needed:

    <div style="float:left;margin-right:10px;" class="expandall">[expand findme="310" scrollonclose="310" Title="Open All Folders" rel="docs-highlander"] [/expand]</div> <div style="float:left;" class="collapseall">[expand findme="1" scrollonclose="1" Title="Close All Folders" rel="docs-highlander"] [/expand]</div>

    The “Open All Folders” works great, but the “Close All Folders” won’t scroll to the right place unless you’ve just used the “Open All Folders”. Can’t figure it out.

    Also wondering how to get rid of off the empty space at the bottom of the page when all the [expand] elements are collapsed.

    Thread Starter rodmusic

    (@rodmusic)

    This seems to work”

    <div style="float:left;margin-right:10px;"><span class="expandall">[expand findme="310" scrollonclose="310" Title="Open All Folders" rel="docs-highlander"] [/expand]</span></div><div style="float:left;><span class="collapseall">[expand findme="1" scrollonclose="1" Title="Close All Folders" rel="docs-highlander"] [/expand]</span></div>

    Plugin Author Baden

    (@baden03)

    So… is this issue resolved, or is there still something to suss out?

    Thread Starter rodmusic

    (@rodmusic)

    Yes, I’d say it’s resolved. It’s doing just what I want it to. Putting the expandall/collapseall classes in the span was the ticket. Using the divs kept the two triggers on the same line. I’m using the expand shortcodes just to trigger the expandall collapseall for everything else on the page, and I discovered the need to have a space in the content area. Thanks for your suggestions!

    I still have the issue of the blank space at the bottom of the page when everything is collapsed, but that seems to be an issue with my page theme since it doesn’t happen in a post, or in a page using other themes I tried it with. If you have any suggestions, I’d appreciate it.

    Thread Starter rodmusic

    (@rodmusic)

    I should clarify that the extra space is in the page background, not in the content area. And it does the same thing in a post. Definitely a theme issue. Hadn’t really noticed it in other places I was using Collapse-O-Matic because there was less hidden content pushing the length of the background.

    Thread Starter rodmusic

    (@rodmusic)

    Just upgraded to Collapse-Pro-Matic. Don’t need extra features for know, but maybe it does something I don’t know I need yet! πŸ™‚

    Thread Starter rodmusic

    (@rodmusic)

    Didn’t think I needed Collapse-Pro-Matic, but upgraded to show support for your super cool plugin. Then I started thinking that Toggle feature might be nice. http://fgmea.org/test

    Started with:
    [expand title="Expand All" swaptitle="Collapse All" trigclass="setall"/]

    Ended up with:
    [expand title="Open All Folders" swaptitle="Close All Folders" findme="290" scrollonclose="150" trigclass="setall" rel="docs-highlander"] [/expand]

    It needs a content area (single space will do) for the findme/scrollonclose to function. I was very pleased that I can put my Toggle in several places and they all switch together. Love it!

    Plugin Author Baden

    (@baden03)

    Very glad everything worked out. Do let us know if we can be of further assistance. Topic marked as resolved.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Combine scrollonclose with collapseall?’ is closed to new replies.