1

I am using the draggable UI jquery plugin to simulate movement in a map or a "touchcreen" or whatever. In fact I have what I want did with mootools in this link: http://bloodblog.net/test/cabocity/main.html (Chrome, chrommium and ¿old? firefox only).

It contains this:

html:

<div id="touchpad" ></div>
<div id="cont"><!-- here a lot of things --></div>

The handler here is the touchpap. It is on top and it doesn't move never. It moves, when drag, the cont element.

I am trying to do the same in jquery but when I use the "handler" option of the draggable ui-jquery plugin doesn't happen nothing: it is not nested of the drag element.

Here is the doc of the jquery plugin: http://jqueryui.com/demos/draggable/#handle


Here is the structure in mootools: comment#4 but i wanna make it in jquery: (comment #2)/ but it doesn't work because touchpad isn't nested too container div. Here is when container is over all: (comment #3) (this work, but doesn't a solution because you can only drag over red background).

PS: sorry for the links, i can't post all of them.

José Cabo
  • 6,149
  • 3
  • 28
  • 39
  • Could you create a jsFiddle showing what you have tried? – kapa Aug 16 '12 at 20:16
  • Thanks. Here is the structure with jquery: http://jsfiddle.net/2wzrQ/2/ – José Cabo Aug 19 '12 at 14:51
  • If you use only the "container" div as a draggable div ( http://jsfiddle.net/VDy4J/2/ ) and it is ontop and then you drag it it.. moves (of course). The problem is you can only drag it clicking in that element, the red background. – José Cabo Aug 19 '12 at 14:52
  • The touchpad solution is similar but the touchpad is ON TOP and it never moves but receive the mouse movement and propagate the "drag movement" to container div. Even when container div isn't visible you can "drag" touchpad (and then it propagate) until container is visible or whatever. – José Cabo Aug 19 '12 at 14:53
  • And here is the same did with mootools and its drag fantastic plugin: http://jsfiddle.net/9xJTa/1/ . *The touchpad is over the container element and it receive the movement of the drag event (handler) but which moves is the container element*. This is what I need with jquery. – José Cabo Aug 19 '12 at 15:15
  • http://stackoverflow.com/questions/5744068/drag-div-by-handle-that-is-not-nested – ivan133 Apr 29 '14 at 11:40

0 Answers0