Side menu and getOpenRatio when content released


#1

Hi guys and thank you for this awesome framework.

I’m working on a project which uses the slide menu component and the getOpenRatio method to change the zoom during the drag of the content.

When I release over the 0.5, obviously the content will open (or close) to the end but the value of the function getOpenRatio go directly from 0.5 to 1 with no intermediate values​​, resulting in a non-smooth zoom animation.

This is a desired behavior or there is another method to obtain the intermediate values​​?

Thank you.


#2

Can you provide a codepen example of what you have for code?

Take a look at this example of how to use getOpenRatio


#3

http://codepen.io/devneri/pen/joxhi

This example is very simple (I’m new to Angular and Ionic), but as you see the opacity of side menu pass from 0.45 (depending on release position) to 0 with no intermediate values.

I’v put a console.log inside the $watch so you can see better the value of getOpenRatio.

Thank you.


#4

Sooo two things

  1. this kind of functionality should be a directive, not done in a controller.
  2. I think the reason it was flashy was the background color. I removed it in this example and it seems pretty smooth