1

我到底做错了什么?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Draggable crop</title>
        <script type="text/javascript" src="/scripts/jquery.js"></script>
        <script type="text/javascript" src="/scripts/jquery.ui.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.image_outline').resizable();
            });
        </script>

        <style type="text/css">
            .image_outline {
                border: dashed 1px #000;
                width: 300px;
                height: 200px;
            }
        </style>
    </head>

    <body>
        <div class="image_outline"></div>
    </body>
</html>

这是 jsfiddle 上的代码:http: //jsfiddle.net/dAHt8/

为什么可调整大小的插件不能div调整大小?

4

1 回答 1

2

添加正确的 CSS 链接后工作正常:

jsFiddle 示例

对于那个 jsFiddle,我在以下位置链接到托管的 jQuery UI CSS:http ://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css

于 2012-05-24T18:11:30.493 回答