Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Draggable IFrameFix

I have a little problem with the jQuery Draggable IFrameFix. I have a container (as shown below) with an iframe inside of it. I turned on the iframeFix in my draggable setup, but it doesn't change a thing. Anyone who had the same problem or anyone who might know how to solve this?

<div class="container">
<div class="toolbar">
    <div class="opt1"></div>
    <div class="opt2"></div>
</div>
<iframe src="url" class="frame" frameborder="0" scrolling="no"><p>No support for iframes</p></iframe>
</div>

This if my javascript code.

$(".container").draggable({
        snap: ".snapper_col",
        containment: "#element_container",
        handle: '.opt1',
        snapTolerance: 20,
        iframeFix: true,
        cursor: "crosshair",
        start: function(ev,ui){
        },
        drag: function(ev,ui){

        },
        stop: function(ev, ui){

        }
});

Thanks!

like image 355
jeroenjoosen Avatar asked Feb 02 '23 19:02

jeroenjoosen


1 Answers

Solved it.

I created my own overlay over my iframe and when I start dragging I display it and hide it when I stop. This way the iframe doensn't mess with the dragging.

like image 57
jeroenjoosen Avatar answered Feb 05 '23 18:02

jeroenjoosen