jquery.ui.position在定位项目时没有获取边距值?
我有这个例子,显示左右div之间没有分离......
http://jsbin.com/ebamom/3/edit
我做错了什么?
提前致谢!
答案 0 :(得分:0)
你可以使用一个Div来给两个div之间的差额。我检查了这个,找到两个div之间的空格。
HTML CODE
<!DOCTYPE html>
<html>
<head>
<link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
.recuadro {border:solid;}
</style>
</head>
<body>
<div id="container" style="height:200px;width:300px;" class="recuadro">
CONTAINER
<div id="left" style="height:150px;width:100px;margin:10px" class="recuadro">LEFT</div>
<div id="between" style="height:150px;width:1px;margin:10px" class=""></div>
<div id="right" style="height:100px;width:80px;margin:10px" class="recuadro">RIGHT</div>
</div>
</body>
</html>
Javascript代码
// Testeo de jquery.ui position
$(document).ready(function(){
$("#between").position({my:"left top",at:"right top",of:"#left"});
$("#right").position({my:"left top",at:"right top",of:"#between"});
});