This is a test of the new findme options available with collapse-o-matic. In addition to the values of ‘auto’ and a fixed numeric offset, the findme attributes now supports ‘trigger’ and ‘target’.
For target to make sense, there would need to be content between the trigger and target. We do this using the roll-your-own method:
<div class="collapseomatic find-me" id="my_example" title="trigger text" data-offset="-60" data-findme="target">trigger text</div>
some bulky content. Notice the offset of -60, this is to compensate for the sticky menu element at the top of the page.
<div id="target-my_example" class="collapseomatic_content ">Target Content</div>
trigger text
This is some bulky content… how about a picture of a donkey.
we should only have to calculate year, month and week time units once, as they will likely change only one time per viewing. Even so, we will need to properly calculate the amount of days, weeks and months remain, depending on how many time units are currently being displayed. We use a test of +410 days and 10 seconds from now to test how the change over works for the larger time units.
Test 1 – Showing Everything
This test should show everything: Years, Months, Weeks, Days… and the rest. [tminus t="+410 days +10 sec" style="TIE-fighter"/]
weeks
5
8
days
0
4
hours
0
0
minutes
0
0
seconds
1
0
Test 2 – No Weeks
This test should show everything: Years, Months, Weeks, Days… and the rest. [tminus t="+396 days +10 sec" omitweeks="true" style="TIE-fighter"/]
days
3
9
6
hours
0
0
minutes
0
0
seconds
1
0
Test 3 – No Months
This test should show everything: Years, Months, Weeks, Days… and the rest. [tminus t="+394 days +10 sec" omitmonths="true" style="TIE-fighter"/]
weeks
5
6
days
0
2
hours
0
0
minutes
0
0
seconds
1
0
Test 4 – No Months or Years
This test should show everything: Years, Months, Weeks, Days… and the rest. [tminus t="+394 days +10 sec" omitmonths="true" omityears="true" style="TIE-fighter"/]
weeks
5
6
days
0
2
hours
0
0
minutes
0
0
seconds
1
0
Test 5 – No Months or Weeks
This test should show: Years and days. [tminus t="+366 days +10 sec" omitmonths="true" omitweeks="true" style="TIE-fighter"/]
days
3
6
6
hours
0
0
minutes
0
0
seconds
1
0
Test 6 – Days Only
This test should show only days: [tminus t="+45 days" omityears="true" omitmonths="true" omitweeks="true"/]
This is a quick test to try out the new years and month options added in version 2.3.20… this looks like it might end up being version 2.4.0 at this rate. Yup, it will be a major release.
Test 1 – Show it All
This test should show everything: Years, Months, Weeks, Days… and the rest. [tminus t="+410 days +10 sec" style="c-3po"/]
weeks
5
8
days
0
4
hours
0
0
minutes
0
0
seconds
1
0
Test 2 – Omit Years
This test will omit the years, resulting in expanded months. [|tminus t="+410 days" omityears="true" style="c-3po"/]]
weeks
5
8
days
0
4
hours
0
0
minutes
0
0
seconds
0
0
Test 3 – Omit Months – Keep Years
This test will display the years, but convert months to weeks. [tminus t="+410 days" omitmonths="true" style="c-3po"/]
weeks
5
8
days
0
4
hours
0
0
minutes
0
0
seconds
0
0
Test 4 – Omit Years and Months
The title, pretty much says it all. No years, no Months… just a whole lott’a weeks: [tminus t="+410 days" omityears="true" omitmonths="true" style="c-3po"/]
weeks
5
8
days
0
4
hours
0
0
minutes
0
0
seconds
0
0
Test 5 – Omit Years, Months and Weeks
Days for days… [tminus t="+410 days" omityears="true" omitmonths="true" omitweeks="true" style="c-3po"/]
days
4
1
0
hours
0
0
minutes
0
0
seconds
0
0
Test 6 – Omit Weeks Only
No weeks, but the rest. [tminus t="+410 days" omitweeks="true" style="c-3po"/]
days
4
1
0
hours
0
0
minutes
0
0
seconds
0
0
Test 7 – Omit Months and Weeks
No months, no weeks. [tminus t="+410 days +10 secs" omitmonths="true" omitweeks="true" style="c-3po"/]
days
4
1
0
hours
0
0
minutes
0
0
seconds
1
0
Test 8 – Omit Years and Weeks
No years, no weeks. [tminus t="+410 days" omityears="true" omitweeks="true" style="c-3po"/]
This is a test where a scroll-to target will open an expand, however will then scroll back to the top of the page–or actually an element at the top of the page defined as: <h2='top'>Scroll Target at Top<H2>
Scroll Target at Top
This is just some filler text to move the expand item a bit further down the screen. In fact, why not just throw in an image and save us all a heap of blibber blabber text. Here is a photo of a donkey stuck in a manhole cover. Silly donkey, you are not a man… you’re a donkey.
Now we place an expand element with a defined ID and scrolltarget value: [expand title="trigger text" id="monkey" scrolltarget="#top"/]
trigger text
This is some hidden text about a monkey in a bucket.
will scroll down to the monkey element, open it, then scroll back up to the top element. This bouncing around is quite annoying.
Introducing: hash-trigger
This is a test where we introduce a new attribute called hash_trigger. This is an secondary id that will be use to expand but not scroll to a collapse element based on the url anchor hash. For example. We create an expand element like so: [expand title="trigger text" id="smashing" hash_trigger="pumpkins"/]
trigger text
This is some hidden text that will expand but not scroll to
Now when we link directly to the page with the url anchor hash of #smashing it will scroll to and expand the element above as normal. However, if we use the url anchor hash of #pumpkins it will only expand the element and NOT scroll anywhere , providing: 1. there is no other element with an ID of pumpkins 2. there is no scroll-to attribute defined on this expand element.
Note: to assign the hash_trigger using the roll-your-own method, simply assign a data-hash-trigger attribute to the trigger element:
In the case of a large gallery of images, it could happen that a page break would split images across pages.
For example, what happens when this gallery is printed?
Here is an example of how to pimp the collapse-o-matic expand to use a grey bar style using CSS.
Be sure you are using the div ad your default tag in the plugin settings.