Protaculous Observer can do this pretty directly. Apply the Action to the box, then choose scriptaculous-packed in the Library menu. In the first DOM Event field, enter mouseenter
if you’re using Freeway Pro 5.6.2 or greater, mouseover
if you’re using any version less than 5.6.2. Click on the Function Body button, and enter the following:
this.morph('background-color: #ff9', {duration: 0.4});
Now on the next DOM Event field, enter mouseleave
or mouseout
(same reason to choose one or the other) and in the Function Body, add:
this.morph('background-color: #fff', {duration: 0.4});
See how that works. (Also, change the second color to whatever color your DIV really was, I just assumed white.)
Now if you like the effect, and you want to apply it to a bunch of different elements on the page, then you will want to refactor this code so you don’t have a separate instance of this function applied to each box on the page separately. Use a class like fader
to mark out the boxes you want to affect (use Item / Extended or my Add Selector Action to apply the classname) and then write something like this in Protaculous (remove the Observer you added earlier, it will clash).
$$('.fader').each(function(elm){
elm.observe('mouseenter', function(evt){
this.morph('background-color: #ff9', {duration: 0.4});
});
elm.observe('mouseleave', function(evt){
this.morph('background-color: #ff9', {duration: 0.4});
});
});
Put that in the top Function Body in a Protaculous applied to the page, and any element on the page that you’ve applied the fader classname to will use this behavior.
Walter
On May 19, 2012, at 8:29 PM, tobiaseichner wrote:
Hello,
I’m looking for an easy method adding a rollover effect to a DIV box. Basically on mouse over the background colour should change (some cool effects like fading or opacity would be nice, but are no requirement).
Of course, it could be implemented manually by using advanced CSS, but maybe there is something more “Freeway-style” (aka action) already available ?
Thank you,
Tobias.
actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options