Home > front end >  Drag and drop in on js control it
Drag and drop in on js control it

Time:10-04

I have inside and outside two layer DIV, are set up to allow drag,

When I drag the outer div respectively, and the inner div, moves with the mouse the translucent images are not the same (the translucent images can be an intuitive feeling that gives a person is I now drag and drop is what),

Now there are two problems:

1: I want to achieve the effect of is, when I hold down the mouse to drag and drop on the inner div, if I hold down the CTRL key at the same time, the hope can achieve and the effect of drag the outer div is the same, the mainly hope that moves with the mouse the translucent images, and drag the outer div is the same (that is, let a person feel is: although I drag and drop is the inner div, but because of I and hold a key, so I now in the drag and drop is the outer div), and release the CTRL key, the translucent images can then switch back to the picture of the inner div

2: when I inner div, do not set the draggable, hold down the mouse on my inner div, and press CTRL, can drag and drop, seemingly as drag and drop is the outer div, but when I press the shift key, and hold down the mouse on the inner div, at this time no response, how do I set to reach and press the CTRL key effect,

 
The function dragstartDiv (ev) {
Ev. DataTransfer. SetData (" Text ", ev. Target. Id);
}
</script>
The outer div
The inner div


CodePudding user response:

Have bosses did yao, bosses to reassure genuflect is begged
  • Related