Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot drag elements in an Iframe

I have a page with an iframe to a another page with two columns, where you can drag an element from the first column to the second. The code I have for the iFrame is simple

 <div style="width: 1000px; ">
  <iframe id="isurvey" frameborder="0" style="width: 102%; height:1000px" src="https://www.thriveonsoftware.com/test.php" onload="window.parent.parent.scrollTo(0,0)">
</div>
 </div>

If you go to bottom of the first column by scrolling (which is out of the viewport) you cannot drag the element from the first column to the second. This is easiest to see by going here:

http://codepen.io/amweiss98/pen/OXBqGy

Just scroll down to the option called "Public Relations" or "HTML" and then try to drag that to the second column...you won't be able to.

This seems like a common problem for long lists.

Does anybody have a solution for this?

like image 983
Allen Avatar asked Aug 07 '16 22:08

Allen


People also ask

How do you drag an iframe?

iframe Part Drag start is triggered by a draggable element inside iframe. For better performance, dragging and drag end event listeners are attached in drag start and are detached in drag end. Dragging event listener is required here because the mousemove event of the upper frame breaks inside the iframe.

Can you iframe a specific part of page?

If you want to display specific area of external website using iframe, then you will learn in this article how to embed a specific part of a web page using css. Suppose, you want to show only one div element from another website and want to hide some specific content, then you can easily do this using <iframe> tag.


1 Answers

The dragging works fine, the issue is the height of the second div #sortable2.

http://codepen.io/amweiss98/pen/OXBqGy

If you click + hold on 'HTML', and then scroll back to the top, you can drop the box into the second div fine. This is because the second div has;

min-height: 60px;

If you want to be able to drag anywhere to the right, you need to make sure that #sortable2 is actually there i.e. #sortable2 should be the same height as #sortable1.

like image 142
JayIsTooCommon Avatar answered Oct 04 '22 01:10

JayIsTooCommon