开发者

image disapper after opening it in a jquery dialog

i have a code that opens the image in a dialog when clicked and it works fine but the problem is t开发者_运维百科hat the image clicked disappear from its position after it opens in the dialog, here is the code i am using:

        $(function () {
        $("img").click(function (s) {
            $(this).dialog({
                height: 750,
                width: 650,
                modal: true,
                zIndex:900
            });
        });
    });

what is the problem , thanks


You could open a clone of the image, so the original doesn't disappear:

   $(function () {
        $("img").click(function (s) {
            $(this).clone().dialog({
                height: 750,
                width: 650,
                modal: true,
                zIndex:900
            });
        });
    });

Hope this helps. Cheers

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜