English 中文(简体)
j Query Draggable Inputs
原标题:jQuery Draggable Input Elements

我正试图利用“团结倡议”来编造一些要素。 例如,纽州、检查箱、文字区等。 到目前为止,我没有幸运。 你们是否有什么想法来实现这一目标?

问题回答

也许3年太晚,但你可以寄出事件,并在大声疾呼之后使用更预期的行为:

DEMO jsFiddle

$(".draggable").draggable({
    start: function (event, ui) {
        $(this).data( preventBehaviour , true);
    }
});
$(".draggable").find(":input").on( mousedown , function (e) {
    var mdown = new MouseEvent("mousedown", {
        screenX: e.screenX,
        screenY: e.screenY,
        clientX: e.clientX,
        clientY: e.clientY,
        view: window
    });
    $(this).closest( .draggable )[0].dispatchEvent(mdown);
}).on( click , function (e) {
    var $draggable = $(this).closest( .draggable );
    if ($draggable.data("preventBehaviour")) {
        e.preventDefault();
        $draggable.data("preventBehaviour", false)
    }
});

trick计包括:

div div{
    position:absolute;
    z-index:2;
    height: 100%;
    width: 100%;
}

div input{
    position:relative;
    z-index:1;
}
<div><div>&nbsp;</div><input type="text" value="..." disabled="true"/></div>
$( body>div ).draggable();

我认为这符合你的要求: 它在投入要素上可观的+可变,但你不会失去其本质,成为不可调和的。

$(function(){
    $( .draggable ).draggable().resizable();
});

这里,我对你的解决办法是:my jsFiddle

另一种选择是将其总结下来,并为投入设立这一中心:

pointer-events: none;

你们能够进入修改投入价值。

最好的解决办法是,你将这些问题分成四级或跨度。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...