Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Avizzv92

macrumors regular
Original poster
Mar 23, 2008
172
0
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?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
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.

-Lee
 

Avizzv92

macrumors regular
Original poster
Mar 23, 2008
172
0
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...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.