0
A
回答
3
應該不是問題。首先計算視口的高度。然後將高度分配給dialog
屬性。不知怎的,像這樣:
var windowHeight = $(window).height();
$('.myTable').dialog({'height': windowHeight});
// or use the maxHeight-property...
0
你不能指定「auto」作爲height屬性的值嗎?從docs:
對話框的高度,以像素爲單位。指定'auto'也支持根據其內容來調整對話框。
0
加上faileN的答案,如果你想顯示整個表,由於窗口大小,你可以設置它的高度,窗口大小。
var wHeight= $(window).height();
var wWidth = $(window).width();
$('.myTable).dialog({'height': wHeight, 'width':wWidth });
0
做這樣的事情:
var $table = $("#tableId"),
$window = $(window);
$table.dialog({
// other properties set here ...
maxHeight: $window.height() - 50,
maxWidth: $window.width() - 50,
height: $table.outerHeight(true) + 50,
width: $table.outerWidth(true) + 50
});
// I always give some room, hence the 50
相關問題
- 1. Flash動態調整大小
- 2. iFrame動態調整大小
- 3. 獲取模態以在窗口大小調整時動態調整大小
- 4. 統一調整大小下拉動態
- 5. 調整動態數組的大小
- 6. JQuery:動態圖像調整大小
- 7. 動態列表視圖調整大小
- 8. 動態圖像調整大小
- 9. 動態調整輸入大小
- 10. 動態地調整HTML Widget的大小
- 11. SSRS動態列大小調整
- 12. 動態調整大小的線程池
- 13. 動態調整大小閃亮textAreaInput框?
- 14. Cufon動態調整大小,可能嗎?
- 15. iphone開發:動態調整大小UITableView
- 16. 用MPlayer和PyGTK動態調整大小
- 17. 信號量動態調整大小C#
- 18. Cocoa-Touch:動態調整視圖大小
- 19. 動態調整列大小在.Rprofile
- 20. JavaFX 2窗格動態調整大小
- 21. 動態調整字體大小
- 22. 動態調整UILabel的內容大小
- 23. CSS圖像動態調整大小
- 24. 動態調整輸入大小
- 25. 動態圖像調整大小
- 26. Android動態調整大小的容器
- 27. 動態調整iframe的大小
- 28. 動態圖像大小調整
- 29. 動態調整多個div的大小
- 30. 動態調整圖像大小?
你可以像麻袋說,離開的高度和寬度孤單,因爲它們設置爲''auto'',然後你可以設置maxHeight和如果內容超過視口,maxWidth屬性將強制執行滾動。或者,如果你想手動做高度和寬度,你也可以這樣做,就像我的答案一樣。 – 2011-05-13 18:03:51