开发者

Draggable object hides outside content when wrapt in span

开发者 https://www.devze.com 2022-12-27 10:49 出处:网络
I have a simple CSS problem In this site http://web.cinaird.se/pdf/test.htm (<--removed) I have a draggable images in the top content, I want a span that float on topof the image and for this I n

I have a simple CSS problem

In this site http://web.cinaird.se/pdf/test.htm (<--removed) I have a draggable images in the top content, I want a span that float on top of the image and for this I need a开发者_开发知识库 span containing the image and a span floating on top. So long no problem but now when i drag the image it hides outside the top content.

so my question is as follows, how can I wrap a image and a floating span above and still be able to drag it outside the container.


you need to change

function setDraggable(){
    $("#topContent img").draggable({
        opacity: 0.7,

        revert: 'invalid',
        helper: 'clone',
    });
}

to

function setDraggable(){
    $("#topContent img").draggable({
        opacity: 0.7,
        appendTo: 'body',
        revert: 'invalid',
        helper: 'clone',
    });
}

so the element's parent container will be the body

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号