View Full Version : Dashcode Button Question.

Apr 3, 2008, 03:48 PM
I'm adding a button to my widget, I have no problem adding the button and getting it too work. But I want the button to "fade in" on mouseover, I can do this, but how do you make the button "invisible" until the "mouseover" triggers the fade in animation?

Apr 3, 2008, 04:12 PM
This is a very general suggestion, as I know nothing of Dashcode...

Have your image be a transparent png the size of your button. Have it fade to the "real" button image.

If you need the real button image to stay up after the first mouseover, I have no idea how you might do that.


Apr 3, 2008, 04:15 PM
I was thinking of that, but wondering if there is a "proper" way to do it. Also another question, when adding a animation function to objects say you have 3 buttons (button1, button2, button3) and you want them to have all the same function.

Is there a way to add more then one button too respond to this function?

function fade3(event)
// Values you provide
var itemToFadeOut = document.getElementById("button1"); // replace with name of element to fade

// Fading code
var fadeHandler = function(a, c, s, f){ itemToFadeOut.style.opacity = c; };
new AppleAnimator(500, 13, 1.0, 0.0, fadeHandler).start();}

Something like this ...var itemToFadeOut = document.getElementById("button1", "Button2", Button3")

I'm still learning about dashcode and kinda new...