Languages

Menu
Sites
Language
I want my canvas to be drag within the screen of device

Hi,

I have developed an application in which i want my canvas to drag only within the screen.My canvas move ouside the screen.How can i resolve this problem.

 

 

Please help me

Thanks and regards

Mohit Kumar

Edited by: mohit kumar on 31 Aug, 2015

Responses

5 Replies
Alex Dem

Hi ,
What do you mean: if you canvas is outside of screen - then just reduce canvas size, or what?
Alexey.

mohit kumar

Hi Alex Dem,

Here i have three cnavas.first canvas,second canvas,third canvas.First canvas is bigger.Second and third canvas are smaller.First canvas is not dragable.Second canvas and third canvas are dragable.I want secon and third canvas should be drag within the area of first canvas.

Please help me.

 

Thanks in advance

Thanks and regards

Mohit Kumar

 

 

colin Rao

seems the canvas can't be embded into another canvas. why not to use a div. 

Possible, you need to know the first canvas position, width & height, then try to register touchmove event on canvas 2&3, in the event callback to check the positon of canvas 2/3, compare with the first canvas position info, if it's out of the first canvas then set to 0 or any else.

similar topic https://developer.tizen.org/forums/web-application-development/i-have-use-drag-event-it-drag-only-left-right-and-right-left

Palitsyna

Hello,

Try to use jCanvas plugin: http://projects.calebevans.me/jcanvas/ Probably it is something you are looking for.

Seoghyun Kang

Hello,

 

I checked the jCanvas that Palitsyna mentioned.

When I run the jCanvas, it is powerful and easy. That's why I also think it will be helpful to you.