最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery ui resizable bug解決方法

 更新時間:2010年10月26日 09:31:55   作者:  
其實(shí)這個也不算是 resizable 的BUG,但從官網(wǎng)下載下來的確實(shí)存在問題
但開啟 helper: 'ui-resizable-helper' 或animate: true, 時候,會發(fā)現(xiàn)官方的例子的寬度自動增加了10PX 仔細(xì)翻源代碼一看,發(fā)現(xiàn)有以下問題:(如圖)


竟然用padding 難怪會自動添加寬度
這個問題在ie firefox下都存在.
其中這個問題比較難發(fā)現(xiàn),但你可以用以下代碼測試出來:
復(fù)制代碼 代碼如下:

<style type="text/css">
#resizable { width: 350px; height: 150px; padding: 0.5em; }
#resizable h3 { text-align: center; margin: 0; }
.ui-resizable-helper { border: 1px dotted #ddd; }
</style>
<script type="text/javascript">
$(function() {
$("#resizable").resizable({
maxWidth: 350,#讓最大寬度和最小寬度一致
minHeight: 150,
minWidth: 350,
helper: 'ui-resizable-helper'
});
});
</script>
</head>
<body>
<div id="resizable" class="ui-widget-content">
test
</div>
</body>


只要把上面的

 #resizable { width: 350px; height: 150px; padding: 0.5em; }
 #resizable h3 { text
-align: center; margin: 0; }

改為:

 #resizable { width: 350px; height: 150px; }
 #resizable h3 { text
-align: center; margin: 5px; } 

即可.

其實(shí)細(xì)心一點(diǎn)會發(fā)現(xiàn)還有問題:

 

其實(shí)就是ui-widget-content的邊框的大小為1px造成的,所以,我們改把#resizable的寬度在縮小2px

修改代碼:

 #resizable { width: 350px; height: 150px; }

為:

#resizable { width: 348px; height: 150px; } 

在測試,正常了.

發(fā)現(xiàn)JQUI的小問題還真不少....

相關(guān)文章

最新評論

东山县| 静海县| 革吉县| 定西市| 交城县| 沛县| 叙永县| 隆尧县| 安多县| 安宁市| 昭平县| 磐安县| 资源县| 望谟县| 太仓市| 闵行区| 婺源县| 海安县| 鸡泽县| 台北县| 隆回县| 千阳县| 嫩江县| 原阳县| 绿春县| 纳雍县| 林甸县| 绍兴市| 双峰县| 大宁县| 景东| 墨脱县| 莎车县| 宜州市| 台北县| 横山县| 宜昌市| 阿鲁科尔沁旗| 大埔县| 开鲁县| 峨边|