I’m trying to change the object that drops when it activates with mousedown. For example:
I have a list with <a> tags, when I’m dragging it to a textarea and drops it. I get the url as a string. But I don’t want the full url when I’m dropping it (I want a part of it).
href in a-tag look like this: ?page=1 but when I drop it in the textarea I see http://localhost/page.php?page=1
So is it possible to change the outcome of the object when dropping it in the textarea?
Edit:
Current jQuery code:
jQuery("ul.editpages a").mousedown(function(object){
newobject = object.srcElement.innerText;
});
Current HTML:
<ul class='editpages'>
<li><a href="?page=1"><span>Page 1</span></a></li>
</ul>
<textarea class='redactor'>
</textarea>
I’m trying to use the native drag and drop which all modern browsers provide because then I can insert the content att a point in the text, rather than in a position (as jquery droppable and draggable do)
In case someone is interested:
In Google chrome the problem was that I thought it would change on the drop. That didn’t work. It couldn’t find anything in the object when I dropped it. So I changed focus to the things I was trying to drag.
So on
<a>I addeddraggable="true" ondragstart="drag(event)"This is the drag-function.
When I now drag it, it will show up as a formatted string in the textarea.
This won’t work properly in Opera (according to http://help.dottoro.com/ljmpcqdb.php), but since no one has visited our site.