Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在divjquery中包含图像_Javascript_Jquery_Css_Containers - Fatal编程技术网

Javascript 在divjquery中包含图像

Javascript 在divjquery中包含图像,javascript,jquery,css,containers,Javascript,Jquery,Css,Containers,我在容器中包含图像时遇到了一个小问题。当图像被拖到容器外时,图像会隐藏我想要的是图像不会隐藏到容器外我想要图像停在容器处我如何才能做到这一点这里是一个脚本 $('img')。在('click',function()上{ $('#fotos')。附加(''); $('.imgdrag').draggable(); $('#fotos').droppable(); $('.modal content')。可调整大小(); $(“.download”).attr(“href”,$(this.attr

我在容器中包含图像时遇到了一个小问题。当图像被拖到容器外时,图像会隐藏我想要的是图像不会隐藏到容器外我想要图像停在容器处我如何才能做到这一点这里是一个脚本

$('img')。在('click',function()上{
$('#fotos')。附加('');
$('.imgdrag').draggable();
$('#fotos').droppable();
$('.modal content')。可调整大小();
$(“.download”).attr(“href”,$(this.attr('src'));
$(“.download”).show();
});
});
.container5{
背景色:透明;
宽度:220px;
高度:320px;
保证金:自动;
排名:0;
右:0;
底部:0;
左:0;
边框:1px纯红;
位置:绝对位置;
溢出:隐藏;
}
查看可拖动jQuery UI小部件的链接。

这里,

JS

$(function(){
    $('img').draggable({
    containment: '.container'
  });
});

您是否注意到您的代码片段抛出了一些错误??