开发者

Circle menu using jQuery and jQuery Radmenu Plugin

http://goo.gl/zMiYs

Hello all, I managed to implement the menu above partially (menu opens, items appear, items move to destination) with the help of jQuery and jQuery Radmenu plugin. I used the following to make the targeted item rotate/move along the circle more than once because the way the radmenu is implemented, it moves items only once per click/event:

$('#radial_container').radmenu("next").radmenu("next");

However this is the point where I got stuck because I don't see the option to use a callback function once the animation stops (last .radmenu("next")). There is the plugin's "afterAnimation" option but it wasn't useful because it triggers after each .radmenu("next") - in other words too often.开发者_StackOverflow中文版 I also tried to work with jQuery's queue() and dequeue() but didn't have any luck.

I would highly appreciate it if I can get help on how to solve this problem or for pointing me in the right direction where I should look. In the last days, I spent a fair amount of time searching for similar menus but couldn't find anything similar to what I want to do considering it isn't an extremely exotic idea. Thanks!

Edit: Added link to menu explanation.


My previous response was deleted, which upset me a little.

Never mind.

I think the solution you require might be something like this:

onSelect: function($selected){ // show what is returned 
  var i=0;
    while (i<= $selected.index())
    {
      jQuery("#radial_container").radmenu("next");
      i++;
    }
  },

Then just adjust your maths if required to make sure the destination is correct. If you want to be more clever, you can say that if the index is less than half way round the circle, choose prev instead of next.

I hope this helps you out. It's working fine for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜