Hello,
I have a draggable div. The div is hidden and shows on click and fills
the first
tag with information. Then one can click and it gets
ajax content. I want to be able to select the text inside the div but
the whole div is draggable. I made a test div with static content and
the handle worked and I could select text. So it may be something with
the dynamic content tgeneration? Could it be livequery that is the
problem? Here is the html that is generated on first view of the div:
<div id="trekning">
<div id="dragTitle">Ttitle</div>
<button id="trekkNy">Draw</button>
<button id="lukkTrekk">Close</button>
Name
Addresse
5555 City
kalle@example.com
11555555
</div>
The jquery code:
$("button.trekk").click(function(e) {
e.stopPropagation();
var id = $(this).parents("tr:first").attr("id");
trekkQid = id;
var tid = $(this).parents("tr:first").find("td.title").text();
var tid2 = "<div id='dragTitle'>"+tid.substring(7)+"</div>";
$("#trekning").show().html(tid2).append("<button id='trekkNy'>Draw</
button><button id='lukkTrekk'>Close</button>");
$.get("code/ajaxDb.php",{m:"showWinner",qid:id},function(data){
$("#trekning").append(data);
});
return false;
});
// Code for "Draw" button to append data
$("#trekkNy").livequery('click', function() {
$.get("code/ajaxDb.php",{m:"getWinner",qid:trekkQid},function(data){
$("#trekning").append(data);
});
});
/asle benoni