How to implement drag and drop functionality in Iframe with accuracy? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceHow to apply CSS to iframe?Drag and drop elements into an iframe. Droppable area has wrong coordinates and collisions are wrongHow to append data transfer content at specific location on HTML5 drop eventMaking a cross domain iframe interact with drag eventdrag and connectToSortable into sortable DIV inside the iframeDrag and drop directive , no e.clientX or e.clientY on drag event in FireFoxDrag-and-drop to div behind absolutely positioned divDragging element obscures drop targetDrag/Drop functionality on set of iframes using angularJS behaving unexpectedly
Working around an AWS network ACL rule limit
What kind of display is this?
What computer would be fastest for Mathematica Home Edition?
How to pour concrete for curved walkway to prevent cracking?
Am I ethically obligated to go into work on an off day if the reason is sudden?
How can I make names more distinctive without making them longer?
How did the aliens keep their waters separated?
When communicating altitude with a '9' in it, should it be pronounced "nine hundred" or "niner hundred"?
Can't figure this one out.. What is the missing box?
Fishing simulator
What to do with post with dry rot?
Can I throw a sword that doesn't have the Thrown property at someone?
Do we know why communications with Beresheet and NASA were lost during the attempted landing of the Moon lander?
Is there folklore associating late breastfeeding with low intelligence and/or gullibility?
Stop battery usage [Ubuntu 18]
How does modal jazz use chord progressions?
Did the new image of black hole confirm the general theory of relativity?
If A makes B more likely then B makes A more likely"
Using "nakedly" instead of "with nothing on"
Estimated State payment too big --> money back; + 2018 Tax Reform
How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green
Are my PIs rude or am I just being too sensitive?
Why does tar appear to skip file contents when output file is /dev/null?
Why use gamma over alpha radiation?
How to implement drag and drop functionality in Iframe with accuracy?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceHow to apply CSS to iframe?Drag and drop elements into an iframe. Droppable area has wrong coordinates and collisions are wrongHow to append data transfer content at specific location on HTML5 drop eventMaking a cross domain iframe interact with drag eventdrag and connectToSortable into sortable DIV inside the iframeDrag and drop directive , no e.clientX or e.clientY on drag event in FireFoxDrag-and-drop to div behind absolutely positioned divDragging element obscures drop targetDrag/Drop functionality on set of iframes using angularJS behaving unexpectedly
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am able to modify the body content of the iframe and place a input element to the body at particular position on page in iframe, now I want to add drag and drop functionality to it such that user can drag input element and place it anywhere on the iframe which could be empty space or over any text or image.
That too I am able to do but with little success
I tried couple of things
First I used html5 drag and drop feature to do this but it drops the draggable div element according to the event captured, on drop of the element.
i.e I set the div element left and top position with event.clientX, event.clientY & position: absolute.
Something like this :-
function drop(target, event)
var id = event.dataTransfer.getData('Text');
if (!id) return;
var e = document.getElementById(id);
e.style.position = "absolute";
e.style.left = (event.clientX+offsetx)+"px";
e.style.top = (event.clientY+offsety)+"px";
event.preventDefault();
What I want to do is set the div element according to screen coordinates of where I drag the element not according to event captured on drop. On drop it gives coordinates of event captured not real screen coordinates.
Second append draggable element in iframe body and set position to absolute but then the div element manage positioning.
javascript html iframe drag-and-drop
add a comment |
I am able to modify the body content of the iframe and place a input element to the body at particular position on page in iframe, now I want to add drag and drop functionality to it such that user can drag input element and place it anywhere on the iframe which could be empty space or over any text or image.
That too I am able to do but with little success
I tried couple of things
First I used html5 drag and drop feature to do this but it drops the draggable div element according to the event captured, on drop of the element.
i.e I set the div element left and top position with event.clientX, event.clientY & position: absolute.
Something like this :-
function drop(target, event)
var id = event.dataTransfer.getData('Text');
if (!id) return;
var e = document.getElementById(id);
e.style.position = "absolute";
e.style.left = (event.clientX+offsetx)+"px";
e.style.top = (event.clientY+offsety)+"px";
event.preventDefault();
What I want to do is set the div element according to screen coordinates of where I drag the element not according to event captured on drop. On drop it gives coordinates of event captured not real screen coordinates.
Second append draggable element in iframe body and set position to absolute but then the div element manage positioning.
javascript html iframe drag-and-drop
add a comment |
I am able to modify the body content of the iframe and place a input element to the body at particular position on page in iframe, now I want to add drag and drop functionality to it such that user can drag input element and place it anywhere on the iframe which could be empty space or over any text or image.
That too I am able to do but with little success
I tried couple of things
First I used html5 drag and drop feature to do this but it drops the draggable div element according to the event captured, on drop of the element.
i.e I set the div element left and top position with event.clientX, event.clientY & position: absolute.
Something like this :-
function drop(target, event)
var id = event.dataTransfer.getData('Text');
if (!id) return;
var e = document.getElementById(id);
e.style.position = "absolute";
e.style.left = (event.clientX+offsetx)+"px";
e.style.top = (event.clientY+offsety)+"px";
event.preventDefault();
What I want to do is set the div element according to screen coordinates of where I drag the element not according to event captured on drop. On drop it gives coordinates of event captured not real screen coordinates.
Second append draggable element in iframe body and set position to absolute but then the div element manage positioning.
javascript html iframe drag-and-drop
I am able to modify the body content of the iframe and place a input element to the body at particular position on page in iframe, now I want to add drag and drop functionality to it such that user can drag input element and place it anywhere on the iframe which could be empty space or over any text or image.
That too I am able to do but with little success
I tried couple of things
First I used html5 drag and drop feature to do this but it drops the draggable div element according to the event captured, on drop of the element.
i.e I set the div element left and top position with event.clientX, event.clientY & position: absolute.
Something like this :-
function drop(target, event)
var id = event.dataTransfer.getData('Text');
if (!id) return;
var e = document.getElementById(id);
e.style.position = "absolute";
e.style.left = (event.clientX+offsetx)+"px";
e.style.top = (event.clientY+offsety)+"px";
event.preventDefault();
What I want to do is set the div element according to screen coordinates of where I drag the element not according to event captured on drop. On drop it gives coordinates of event captured not real screen coordinates.
Second append draggable element in iframe body and set position to absolute but then the div element manage positioning.
javascript html iframe drag-and-drop
javascript html iframe drag-and-drop
asked Mar 8 at 15:01
varunvarun
63
63
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065863%2fhow-to-implement-drag-and-drop-functionality-in-iframe-with-accuracy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065863%2fhow-to-implement-drag-and-drop-functionality-in-iframe-with-accuracy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown