开发者

jQuery plugin which lets users draw rectangles in a div works in basic setup, but not when implemented in my page?

I'm using this Boxer plugin to allow the user to draw rectangles in a div. I've got it working in this jsFiddle.

But I can't get it working in this one, which is how I would be using it. I think it may be because of the CSS styling? Can anyone tell why it doesn't work?

Thanks for read开发者_StackOverflow社区ing.


The reason is that the plug-in was using jQueryUI 1.7.2, and in the second example you were using the jQueryUI 1.8 Framework, some things are incompatible, see this document on how to update the plug-in to match the new framework

http://jqueryui.com/docs/Upgrade_Guide


You're missing <script> declarations for jQuery and jQuery UI: I updated the head of your sample:

<head>
    <title>Page</title>  
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" media="screen" rel="stylesheet" type="text/css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
</head>

Sometimes it's the simplest things that get ya :)

Updated sample: http://jsfiddle.net/q75J7/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜