I am using jquery ui draggable in order to make a fieldset draggable by user, the whole page is loaded inside an iframe. the problem is that I can drag the fieldset outside the iframe borders, how I can stop that?
<iframe src='test.html'></iframe>
test.html
<html>
<script>
$(".draggable").draggable();
</script>
<fieldset id='draggable'>testing</fieldset>
</html>
Use the UI containment option
$('.draggable').draggable({
containment: "parent";
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With