rezoner

rezoner does not currently provide support for this item.

22 comments found.

Hi there, I know this could be a stupid question but, is there a way of changing orbital radius for different menu options? I have a problem with long menu titles and this could save me time, but I find that when changing the .orbit radius for that menu item it gets mispositioned.. can you please tell me a javascript way of doing this?

it was one of the first lines of the javascript, and it was written in the documentation, thanks a lot by the way, great idea

Sometimes if we have lots of planets around the sun when coming with the mouse from any direction we may trigger an orbit expansion of some planet at the same time the central sun orbit expands. So it does not work so nice. I made a fix for this. The fix contains some guessing for a compensation value, mine was -26 when my sun has a width of 70 pixels and the planets of 60 pixels. it has to do with how the elements’ corners are positioned on canvas. Also the minimum distance permitted to allow expansion of the first orbit is also experimental – I did measure it with console.log. At full expansion of my planets the distance was 147 pixels so I chosen the value of 140.

Nevertheless here is my fix, I inserted my code after line 180 and I calculated the distance from the center of the planet to the center of the sun. To do this I gave the sun an id of “sun” so i can select it.

$o.mouseenter( function(){ $this = $(this); var data = $this.data("jOrbital"); if( data.mousePropagation ) if( $this.hasClass('animated') ) return false; var pos = $this.offset(); //richard's tweakings var possun = $('#sun').offset(); //find sun position var compensate = -26; var distance = Math.sqrt(Math.pow(pos.top-possun.top+compensate,2)+Math.pow(pos.left-possun.left+compensate,2)) ; //calculate distance if ( $this.attr('id')!='sun' && distance < 140) return false; //do not allow expansion if the planet is too close to the sun //original continues from here var r = $o.outerWidth(); $this.find('jOrbital').hide(); $this.parent().children().css({'z-index':1}); if( data.r == 0 ){ $this.children( data.selector ).show(); data.r = maxDimension( $this.children( data.selector ).children() ) * data.radius; $this.children( data.selector ).hide(); }

Maybe someone can come with a more logical calculations than mine, or the author will include this fix properly in the code.

by
by
by
by
by
by