jquery 放置插件问题,请大神帮下忙~~ 万分感谢

<head>
        <title>放置插件</title>
        <link href="style.css" rel="stylesheet" type="text/css" />
        <script src="http://www.imooc.com/data/jquery-1.8.2.min.js" type="text/javascript"></script>
        <script src="http://www.imooc.com/data/jquery-ui-1.9.2.min.js" type="text/javascript"></script>
    </head>
    
    <body>
        <div id="divtest">
            <div class="box">
                <div class="title">产品区</div>
                <div class="drag"><div>苹果</div></div>
            </div>
            <div class="box">
                <div class="title">回收站</div>
                <div class="cart"><div id="tip">还没有产品</div></div>
            </div>
        </div>
        
        <script type="text/javascript">
            $(function () {
                $(".drag").draggable();
                $(".cart").droppable({
                    drop: function () {
                            $(this).addClass("focus")
                            .find("#tip").html("");
                            $(".title").html($(".drag").html);
                    }
                })
            });
        </script>
    </body> 我这样写是对的吗?

cindy姣姣
浏览 1139回答 1
1回答

wlf1112

这样写没错,是对的
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery