Arrastrar y soltar con clon produce barra diagonal

The code in question is written in straight javascript under Visual Studio 2010 asp.net.

I'm dragging graphic parts onto a diagram. I use drag clones. When I click on one of these graphics, the code positions the drag clone over that graphic and then makes the drag clone visible.

El problema era que el solo la primera vez I try to drag cada drag clone, and if I mousedown and drag quickly, the screen would produce a circle-slash symbol at the same time the drag close appears. The drag clone would then misbehave somewhat.

It took me a while to figure out, but watching closely I saw that the circle-slash appeared before the drag clone. And then, the two comments below explain how I solved it.

preguntado el 24 de diciembre de 12 a las 21:12

I figured out that the circle-slash is caused because the system is telling me I can't drag the static "diagram part" graphic, the one that the drag clone replicates. I'm going to work on that. So this particular phase of the problem is solved. -

And the solution to the problem of the static graphic starting to drag and generating the circle-slash was to make it an ImageButton with an OnClientClick attribute to stop the postback, like below. These inputs are then not draggable like an <img> by itself would be. <input name="dadada" id = "dadada" style="width: 35px; height: 20px;" onclick="return false;" type="image" src="../../My.image.BMP" complete="complete"/> -

The way you answer a question (even one asked yourself) is to post an answer and accept it. Also, it's unlikely that your question will be answered if you don't add any tags or any code. -

2 Respuestas

I figured out that the circle-slash is caused because the system is telling me I can't drag the static "diagram part" graphic, the one that the drag clone replicates.

And the solution to the problem of the static graphic starting to drag and generating the circle-slash was to make it an ImageButton with an OnClientClick attribute to stop the postback, like below. These inputs are then not draggable like an by itself would be.

Respondido el 01 de enero de 13 a las 22:01

Real answer: use JQuery for drag and drop - wayfarer

Use JQuery for drag and drop in javascript

respondido 08 mar '14, 03:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.