jquery ui draggable with iframe wrong droppable position handle -
i'm having issue jquery ui drag/drop. need drag element iframe contains droppable area inside. when drag item on left side , drop iframe, didnt work expected. looks fiddle:
js
$('#my-frame').load(function () { $('.draggable').draggable({ appendto: 'body', helper: 'clone', iframefix: true, revert: 'invalid', connecttosortable: $('#my-frame').contents().find('.sortable'), cursorat: { top: 10, left: 0 }, drag: function(event,ui){ console.log(ui.offset); } }); $('#my-frame').contents().find('.sortable').sortable({ iframefix: true, cursorat: { top: 0, left: 0 } }); }); $('.draggable').on('dragstop',autoresize); function autoresize(){ var newheight; if(document.getelementbyid){ newheight=document.getelementbyid('my-frame').contentwindow.document .body.scrollheight; } newheight=newheight+100; $('#my-frame').css('height',newheight); }
can me fix this? thanks
ok problem come iframe's width. can put in "px" more in "%" ?
look fiddle, offset :
#my-frame { width: 500px; height: 300px; position: absolute; right: 0px; }
Comments
Post a Comment