Can you explain a bit more about what you are trying to do.
David
Sure. I want to use a html box as a trigger for a show/hide target actions. Much akin to what you see at subtlepatterns.com when you mouseover one of the patterns, except I want to use a html item as the trigger.
You can’t do that directly with Freeway, since you can’t apply an A (link) to a DIV (HTML layer). You could replace the Target Show/Hide and Rollover Actions with Protaculous and some hand-code, if you feel up to that. Please let me know and I’ll put something together for you.
Walter
On Sep 15, 2012, at 9:45 AM, Caleb G wrote:
On 15 Sep 2012, 5:50 am, DeltaDave wrote:
Can you explain a bit more about what you are trying to do.
David
Sure. I want to use a html box as a trigger for a show/hide target actions. Much akin to what you see at subtlepatterns.com when you mouseover one of the patterns, except I want to use a html item as the trigger.
If you would be so kind, I would greatly appreciate it. I don’t have to have it on the site I’m building, but would love to know how for future reference.
There are three custom styles, trigger, tooltip, and trigger.hover. These provide both the visual styling and the links needed by JavaScript to create the effect.
The trigger elements are in the same layer order as the tooltips they relate to, and there are precisely as many of each. Without these two rules, there would need to be a lot more code and fiddly bits in the Freeway interface to tell the system which trigger refers to which tooltip.
The Protaculous Action is applied to the page, and the magic code is in the top Function Body dialog in that Action. Be sure you have the latest version installed before you open this document. Here’s the code with comments added to explain what does what.
Hope this helps.
Walter
On Sep 15, 2012, at 12:11 PM, Caleb G wrote:
Walter,
If you would be so kind, I would greatly appreciate it. I don’t have to have it on the site I’m building, but would love to know how for future reference.
As I mentioned in my earlier e-mail, it uses the source order of the page (which translates in Freeway from the stacking order of the layers). So if you create 4 tooltips, stacked from bottom to top as 1-4, and you create four trigger elements, similarly stacked, then the two arrays are populated in the same order when the page loads. Since Freeway keeps the order based on when you created the elements (newer elements above older), then as long as you created the boxes in order, this script will be able to read your mind.
To translate the script:
$$('.tooltip')
means
Starting from the top of the page "tree", find all
elements with the class attribute including 'tooltip'
and store them in an array.
Since arrays have a defined order, and that order never changes after it was created, then when we next run through:
$$('.trigger')
we are doing the exact same thing with a different classname, and get another array of elements also in source order. As long as the two groups of elements are in the same source order (first to last or last to first, makes no difference, and there can be intermediate elements as well) then the trick will Just Work(™).
Walter
On Sep 17, 2012, at 1:20 PM, Caleb G wrote:
Walter,
W-O-W. You are amazing.
I do have one question: how does it link to the right trigger to the right tool-tip? It seems as though it must be reading my mind.