height

Is it possible to have Dojo/Dijit DataGrid autoheight functionality based on the parent div size instead of a number of rows?

99封情书 提交于 2019-12-04 10:22:25
I have a datagrid that is updated periodically and the number of rows inside it grows steadily over time. It is inside of a parent div with a height of 60% of the screen. If I set autoheight to, say, 5 rows, the table works properly. When a sixth row is added, a scrollbar appears within the datagrid and I can scroll up/down and the headers remain fixed at the top and visible. Unfortunately, once I have a lot of data, this is a waste of space -- I have 60% of the screen's height to work with, but only 5 rows are being shown at a time. If I set autoheight to false, the scrollbar that appears is

When child divs are floated, parent divs lose auto-height

拈花ヽ惹草 提交于 2019-12-04 10:01:15
问题 I have a parent div called main. It has a bunch of child divs in it, which I floated left or right. When I finished floating the last one, the height of the main div completely vanished, throwing off the layout of my page. I gave it a height:100%; just for now, but it will be overly tall on most resolutions. How can I keep it at a fluid height, only as much as needed to contain the elements? 回答1: Contain your floats. On the div called main add overflow:hidden; . That should contain it. 回答2:

What exactly does the 'auto' value mean for the CSS height property?

自闭症网瘾萝莉.ら 提交于 2019-12-04 08:01:05
w3schools says that for height : auto : The browser calculates the height. This is default But what does “browser calculates the height” mean? Does it mean it just simply sums up the contained elements’ heights? Is this always calculated with the same method for all browser? What does it mean browser calculates the height ? It means the browser will make the element's height sufficient to fit its content. Does it mean it just simply sums up the contained elements heights if they are up on each other? Nope, it is more complicated than that, but I'm sure that is part of it. Is this always

CSS relative positioning with negative value and height

不想你离开。 提交于 2019-12-04 07:47:11
I'm trying to negative position a DIV element (in the example is #content), but my problem is the div's container (#wrapper2), gets too much height (actually is the height the #content is giving, but as I'm moving the content up, I would like to decrease the height of #wrapper2 accordingly). Here I give you an example to show what I'm trying to achieve. If you try the sample, you'll see that footer stays at too many distance from container. I can make a dirty hack here and make footer top:-200px too but then the scroll bar of the window goes over the footer. <!DOCTYPE html> <html> <head>

Why isn't my function running on document load as expected?

喜夏-厌秋 提交于 2019-12-04 07:43:31
This code should set an elements height; however no style gets added. Am I missing something obvious? function setGround() { document.getElementById('content').style.height = '40px'; } document.onload = setGround; The HTML is quite basic: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Template</title> <link rel="stylesheet" type="text/css" href="css/default.css"/> <link rel="stylesheet" type="text/css" href="css/orange.css"/> <script type="text/javascript" src="javascript/detect-css.js"></script> </head> <body> <header> <div id="logo"></div>

Calculating height using jQuery differs in Firefox and Chrome

孤人 提交于 2019-12-04 07:42:45
I have a question that was already asked here , but the solution offered there did not work. The problem is that I'm using the jQuery height() function to return the height of a div. It works nicely in Firefox, but returns a value that is 300px smaller in Chrome... You can see an example of this bug here . Though I must say it's in Hebrew. Though that shouldn't matter much... Has anyone had that happen before? Here's the code that calculates the height: var heightLeftCol = $('#leftCol').height(); var sidebarHeight = $('#sidebar').height(); var minHeight = heightLeftCol > sidebarHeight ?

JS - File Reader API get image file size and dimensions

半城伤御伤魂 提交于 2019-12-04 07:12:16
Hi i'm using the following code to get the upload image using File Reader API: <script type="text/javascript"> var loadImageFile = (function () { if (window.FileReader) { var oPreviewImg = null, oFReader = new window.FileReader(), rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\

CSS: Make one central div's height expand to fill what's left in a FIXED-HEIGHT container

匆匆过客 提交于 2019-12-04 06:52:16
Sorry guys, it's another CSS height "100%" (sortof) question... I have a layout like this: ---------------. |Containing div | Containing div's height is FIXED | .-----------. | (say 400px for simplicity) | |Inner div1 | | Inner div1 has height fixed (say 50px) | '-----------' | Inner div3 has static-but-unknown content, | .-----------. | height not known at render time | |Inner | | Inner Variable Div should expand to the rest | |Variable | | of the space - i.e. I want to eliminate | |Div | | the "blank space" | '-----------' | | .-----------. | | |Inner div3 | | | |with fixed | | |

How do I find the width/height of ImageView?

馋奶兔 提交于 2019-12-04 06:46:45
问题 My question is similar to this question. I've used this code to extend ImageView to form TouchImageView. In my onCreate() method, I want to call setImage(Bitmap bm, int displayWidth, int displayHeight) but I don't know the width or height to use. When I call getHeight(), it gives me zero. I tried to avoid the 0 using kcoppock's answer to the previously mentioned question, but was unsuccessful. The onPreDraw() listener is called several times per second and I can't figure out how to only call

why is the value of height() in chrome different with safari?

纵饮孤独 提交于 2019-12-04 05:35:58
问题 My script like this : $.ajax({ url: _url, type: 'GET', dataType: "json", contentType: "application/json; charset=utf-8", success: function (result) { ... } }).done(function () { for(var i=0;i<7;i++) { this["td"+i] = $('#bodychel-' + coachId + clubId + ' table tbody td:eq(' + (i) + ')').height(); $('#bodychel-' + coachId + clubId + ' table thead th:eq(' + (i) + ')').css({ height: this["td"+i] }); } }); If I console.log(this["td"+i]); , the result is different between chrome and safari. the