Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Calculation of cursor position is not working properly with a responsive stage

$
0
0

Hi there,

 

I already wrote in another thread about it, but my problem is slightly different to the other discussion, so here again:

 

I want to display a symbol next to the cursor. It should stay there like in this example here: http://sandbox.junglecrowd.org/static/publish/web/static.html

 

When using a responsive Stage (what is crucial to my project, because I need 100% width on all window sizes) the placement ot the symbol is dependent on the size of the window and the position on the screen. Here is an example of the problem:

http://sandbox.junglecrowd.org/responsive/publish/web/responsive.html

 

So, gathering the coordinates within EA seems not to be the right way.. Or does someone know a solution to compensate for the responsivness?

My idea would be to get the coordinates outside of EA.. would this be possible? And in which way?

..of course, any other solutions are very welcome!

 

Below is my code... As you see I'm very new to EA and coding..

Thanks!

 

BTW: I read a lot in this forum before because of other problems, and I found a lot solutions: Thanks to you all!

 

 

// CompositionReady

 

sym.createsym = function(){

 

var position = sym.$("box").show();

var position2 = sym.$("text").show();

  position.css({

    top:sym.posY, left:sym.posX

  });

    position2.css({

    top:sym.posY, left:sym.posX

  });

};

 

// Stage.mousemove

sym.posX = e.pageX + 30;

sym.posY = e.pageY;

 

sym.createsym();


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>