Scripty Accordion and WebYep

As Tim pointed out, the only browser where you would need that is safely buried under soft peat, well on its way to becoming fire starters.

Walter

On Feb 27, 2014, at 9:14 AM, Trevor Reaveley wrote:

Just out of curiosity Tim, although I have it working now from Walter’s instructions, how would I add the dummy links you mentioned earlier?

Just to store the info for a possible future scenario.

Trev

On 27 Feb 2014, at 14:10, Tim Plumb email@hidden wrote:

I’d mentioned the dummy anchors because I had Internet Explorer’s lack of support of pseudo styles on anything other than anchors in mind. Thinking about that again I think it was IE6 that last exhibited this issue - and you know what IE6 users can do? :slight_smile:
…upgrade. That’s right.
Regards,
Tim.
On 27 Feb 2014, at 13:06, Walter Lee Davis wrote:

If you create a new style in Freeway using the Tag-only Style technique (http://actionsforge.com/articles/view/9-tag-only-styles) you can get this effect, with no need for additional dummy links.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Trev,
What I was thinking was you’d select each of the H3 headers in turn and give them a link (Edit > Hyperlink). Switch to the external tab and enter # as the address. This will give each heading a link to an empty anchor and should provide you with links to style using CSS.
Regards,
Tim.

On 27 Feb 2014, at 14:14, Trevor Reaveley wrote:

Just out of curiosity Tim, although I have it working now from Walter’s instructions, how would I add the dummy links you mentioned earlier?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Tim, Walter, thank you both very much for your help on this. The site will be uploaded this pm and I’ll post a link to the relevant page.

Trev

On 27 Feb 2014, at 14:50, Tim Plumb email@hidden wrote:

Hi Trev,
What I was thinking was you’d select each of the H3 headers in turn and give them a link (Edit > Hyperlink). Switch to the external tab and enter # as the address. This will give each heading a link to an empty anchor and should provide you with links to style using CSS.
Regards,
Tim.

On 27 Feb 2014, at 14:14, Trevor Reaveley wrote:

Just out of curiosity Tim, although I have it working now from Walter’s instructions, how would I add the dummy links you mentioned earlier?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

As promised - better late than never. Although it hasn’t been populated by the client yet, the WebYep and Scripty Accordion section is working; thanks all.

http://www.shorestone.co.uk/ourservices.php

Have a good weekend everyone.

Trev


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

With Scripty-Accordion can I set up a style so that when the header is clicked on it changes to a different color.

http://www.smartytest.com/KGuccione/successstories.php

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Not at this time. I should look over this Action at some point, but I haven’t found the time to do that. I have posted a number of recipes for doing accordion effects long-hand with Protaculous 2, it’s really quite simple to do. Any of those could be extended to change the CSS class on the header, which you could then use as a styling cue when the item is open.

Walter

On Mar 20, 2015, at 1:03 PM, billy kimmel email@hidden wrote:

With Scripty-Accordion can I set up a style so that when the header is clicked on it changes to a different color.

http://www.smartytest.com/KGuccione/successstories.php

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you send me the link to those threads?

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Web Yep Rich Text does not work with Scripty Accordion.
The text will not stop overflowing.
The changed it to a Long Text element and it works fine.

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ll go one better – here’s yet another coded-on-the-spot solution to the problem: Accordion Effect

View source to see how it works. If you want to duplicate this in Freeway, copy everything from inside the tag at the bottom of the HTML and paste it into the DOM Loaded Observer window in Protaculous 2.

Pay careful attention to this line of code:

$$('#item2 > *').each(function(elm, idx){

In my example, the accordion elements are all children of the box with the ID item2. Change that word to match exactly what is in the Name/ID field of the Inspector while you have selected your accordion container.

The rest of this is automatic. Whatever the very first child tag is in your accordion container will become the “head” tag. It does not matter what this tag is specifically, as long as it is anything besides the tag you plan to wrap around your disclosure elements. In my example, I used H2 and P tags, respectively. You could use P tags and DIV tags, if you wanted to, or anything else as long as there was a clear difference between the “headers” and the disclosure bodies. (My main point here is that they do not have to be Hn tags specifically – that’s an implementation detail – although it is a good idea semantically.) Whatever that first tag is, throughout the rest of the accordion element, always use that same tag for the other headers in the effect.

Finally, look at the CSS styles in the head of the page. There are three styles that particularly govern how the effect will work:

.accordion-disclosure.closed { display: none }
.accordion-head {
  cursor: pointer;
}
.accordion-head.open {
  color: red;
}

You can extend these however you like. Change .accordion-head.open to your favorite color. Add .accordion-head:hover and make it change color or add a background color when you mouse over it. Obviously set your fonts and other settings how you prefer. But do try to keep the actual HTML in your accordion element as plain as possible. When you select a run of text and change some property of it using the Inspector, you will end up with a mess of inline tags with their own styles set locally. This makes it hard to override later. Your best approach is to create styles manually using the Styles palette. Use the ID of the container element as your “key” to make sure that these styles only apply where you want them to. In the Freeway design view, you won’t see the effect directly, but if you toggle to the Preview mode, or preview in a browser, you will see exactly what you intend.

For example, you might want to set up these styles:

#item2 {
  font: 14px/1.3 Georgia, Palatino, serif;
  color: #333;
}
#item2 h2 {
  font-weight: normal;
  color: #000;
  font-size: 18px;
}

By doing everything at one remove, like this, rather than making a hard style rule exactly for the individual bits of text, you make it easier for your script to override the styling when it toggles the classnames.

Walter

On Mar 20, 2015, at 6:01 PM, billy kimmel email@hidden wrote:

Can you send me the link to those threads?

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And if you ever wondered why I prefer to use Prototype.js for my JavaScript doodling, here’s an example that does not use any library. Note how I have to go through all sorts of gymnastics to do the same work.

http://scripty.walterdavisstudio.com/very-simple-accordion-without-prototype.html

Walter

On Mar 20, 2015, at 6:39 PM, Walter Lee Davis email@hidden wrote:

I’ll go one better – here’s yet another coded-on-the-spot solution to the problem:Accordion Effect


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for all of that Walter. Not sure if I wanna go back and start over. I really like scripty accordion, I just wish there were more styling options built into the action or to be able to extend the CSS Styles.

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The way that this Action is written, it doesn’t really do anything CSS-related when it switches from one state to the other, which means that there are no “hooks” that you can use to change that styling. The JS that I wrote last Friday works the opposite way – all it does is change the CSS classname on the elements when you click, and thus it’s trivial for you to overload that CSS with your own styling. I made one style, which you could change to be what you like, which changes the header from default color to red when it is “open”. Until I have a free moment to make this an Action, you could hardly do worse than to try this out on your own. You’ll learn something from the process, and you’ll be less reliant on others for fancy effects, which is a very good thing.

One of my larger issues with Actions (and CSM plugins, and jQuery) is that people who rely on them utterly can never be any better at their job than someone else who uses those same [pre-rolled whatever]. Further, they tend to believe that "code" is something that other people do, which could not be further from the truth. The first step in getting better at any craft is to understand your tools and your materials. A cabinetmaker who understands wood movement and grain is no less an artist than someone who builds a flashy piece that will shake itself apart in a few seasons. I would argue that they are a better artist, because their work will last.

I will spend more time helping someone who posts a partially-finished-and-non-working example of this, done in Freeway, than I will writing a new Action to make it push-button easy, I promise. I would much rather teach you all to fish than weave another net.

Walter

On Mar 21, 2015, at 2:12 PM, billy kimmel email@hidden wrote:

Thanks for all of that Walter. Not sure if I wanna go back and start over. I really like scripty accordion, I just wish there were more styling options built into the action or to be able to extend the CSS Styles.

Billy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A valid point, and one I agree with, but I suspect it’s also one that’s easily dismissed by the average FW user. SP has done a good job of appealing to the point-n-click crowd, not the get-out-and-pushers.

Todd
https://xiiro.com

One of my larger issues with Actions (and CSM plugins, and jQuery) is that people who rely on them utterly can never be any better at their job than someone else who uses those same [pre-rolled whatever]. Further, they tend to believe that “code” is something that other people do, which could not be further from the truth. The first step in getting better at any craft is to understand your tools and your materials. A cabinetmaker who understands wood movement and grain is no less an artist than someone who builds a flashy piece that will shake itself apart in a few seasons. I would argue that they are a better artist, because their work will last.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options