- Create Account

Sliding animation upwards

Forums > Cascading Popup Menus: Help > Sliding animation upwards
Author
Message

1) Roarky Group: Members
Posts: 3 Joined: 16 Mar 2008 Location: Germany IP: 91.89.--.--
Hi Angus,

a great script, very usable for non-script people like me, too.

I just can't figure out one thing - I'd like to make a sliding animation UPWARDS. Your downwards script goes like this:

  if (!counter)  mD.origY = lyr.y();
  var  newY = (menuH+2)-(menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75);
  lyr.clip(0,  newY, menuW+2, menuH+2);
  lyr.y(mD.origY - newY);

What do I need to change in order to make it go upwards, having the same animation effect?

Thank you!

Roarky

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 118.92.--.--
See the comments in the latest version of pop_data.js, it *should* have a comment in there within the menuAnim function with a line that you can uncomment to enable upwards animation...

- Angus.

3) Roarky Group: Members
Posts: 3 Joined: 16 Mar 2008 Location: Germany IP: 78.42.--.--
Sorry to bother you again, Angus.

You made an example on a clipping animation, but not on the Move+clip sliding animation which you suggested below:

  // Straightforward  downwards clipping animation (default setting):
  lyr.clip(0, 0, menuW+2, (menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75) );
  // If  you want, comment out the above line and enable this one to animate bottom-upwards:
  //lyr.clip(0, (menuH+2)-(menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75),  menuW+2, menuH+2);

  // Another  alternative: Move+clip sliding animation. Looks really cool :).
  //if (!counter)  mD.origY = lyr.y();
  //var  newY = (menuH+2)-(menuH+2)*Math.pow(Math.sin(Math.PI*counter/200),0.75);
  //lyr.clip(0,  newY, menuW+2, menuH+2);
  //lyr.y(mD.origY - newY);

I tried around with my limited programming knowledge, but didn't succeed in making this one go upwards.
Roarky

4) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 202.137.--.--
Oh sorry. Er, yeah, that'll be a little more programming then :). Am a little busy at the moment to do it for free but you'll need to edit the lyr.clip and lyr.y calls. lyr.clip accepts 4 parameters (top, right, bottom, left) and you'll want to alter the bottom rather than the top according to the calculation (leave the top at 0). lyr.y meanwhile should also be reversed so the menu moves up rather than down.

If you want to hire me to modify it email me: /contact/

- Angus.

5) Roarky Group: Members
Posts: 3 Joined: 16 Mar 2008 Location: Germany IP: 91.89.--.--
Hi Angus,

thanx for your kind help - the problem solved itself: people who looked at my design liked the downwards sliding menu much better.

Greetings and a happy Easter Holiday!
Roarky

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.