width

In CSS, how to not float a 300px wide Div to the next line?

谁说胖子不能爱 提交于 2019-12-06 04:09:06
Say, there is a bar that is styled at the bottom of the viewport, using position: fixed; bottom: 0; left: 0; width: 100%; height 50px; overflow: hidden and then there are 4 Divs inside it, each one floated to the left. Each Div is about 300px wide or can be more (depending on the content) Now, when the window is 1200 pixel wide, and we see all 4 Divs, but when the window is resize to be 1180 pixel wide (just 20 pixels less), then the whole 300px wide Div will disappear, because it is "floated" to the next line. So how can this be made so that, the Div will stay there and showing 280px of

How to fix sync issue between column-header-width and column-body-width without the use of deprecated jqGrid updateColumns method?

╄→гoц情女王★ 提交于 2019-12-06 03:28:50
Currently I am working on restoring saved grid preferences/configuration. This is more or less working beautifully, until we get to the last last step of performing that performs a column remap, $grid.jqGrid("remapColumns", perm, true, true); and what happens is that the reordered column-header-widths are out of sync with thier corresponding column-body-widths. This remap does correctly display of both the column-header names and column-body data in the new order and based on user preferences. However, what is wonky is the following. There are three columns: (1) Name (width: 200), (2) Id

How to make Tab pages' widths fit into the TabControl's width

时间秒杀一切 提交于 2019-12-06 01:43:21
问题 I have a TabControl with two tab pages. How can I make the tab pages fit into the width of the TabControl like shown in the below screenshot. I tried with the following line of code but it does not work either. tabControl1.SizeMode = TabSizeMode.FillToRight; 回答1: First, set your tabControl1 size mode: tabControl1.SizeMode = TabSizeMode.Fixed; Then you have to recalculate width of the tab page header: tabControl1.ItemSize = new Size(tabControl1.Width / tabControl1.TabCount, 0); Pay attention:

Select drop down width - Chrome issue

人走茶凉 提交于 2019-12-06 00:30:19
I would like to control <option> list width of <select> drop down. By default, browser calculates larger text in the <option> and accommodes drop down. It doesn't look good in sites. I had tried the following CSS snippet and found working in FF. select{ width : 120px; } select option { width : 90px; } The only trouble causer is Chrome. Could u let me know if any workarounds. Demo Googling it didn't turn out for me. I've only script option left out. The following code does the trick.. /* To trim the charaters in the option list */ var optLen = $('#country option').size(); //console.log("Total

JQuery window width not correct in Chrome

折月煮酒 提交于 2019-12-06 00:02:21
问题 I have created a plugin which i have cut down to the bare bones of a plugin (i.e. no functionality, just the structure) to debug this issue and it still exists. It deals with resizing divs and bases this on the document's width. The problem is that the documents reported width is reduced by 17px from its actual width and thus doesnt size the divs correctly. I have put in alerts to find out where the problem occurs: Before "ready" function: 1780px (correct width) Inside the "ready" function:

How to make a table, which is wider than screen size, scrollable and keep header row fixed?

断了今生、忘了曾经 提交于 2019-12-05 22:45:25
问题 I've a table with 2 columns and each column is 800px wide. I want to show this table in 800x50 window. So there should be horizontal and vertical scrollbar to view complete table. While I've found few related solutions (this and this) on SO, they only work if table width is smaller than screen size. In my case screen size is 1200px and total table width is 1600px. How could I do this? i want to achieve something like this. EDIT Oops, I forgot to add one more requirement. Sorry. I want the

jquery/javascript how to calculate width faster

≡放荡痞女 提交于 2019-12-05 22:19:19
I have a table with 100 columns. I'm running a loop through all the th elements, to explicitly set the width of each th. var $ths = $("table th"); $ths.each(function (i, th) { var $th = $(th); var width = $th.width(); $th.width(width); }); For 100 columns, this takes too much amount of time (more than 60s). Each "get width" call takes 500-700 ms. This is because it needs to generate layout every time, I get width. Question - Is there a faster way to get width? Reason - I'm freezing header. For that I need to set width of each header to fixed pixel width. Everything is dynamic and pre-setting

How can I animate the opposite way?

非 Y 不嫁゛ 提交于 2019-12-05 22:05:35
Greetings, I am changing the width of an element which serves as a bar , and that works. However I can't make it so that it animates it in the opposite direction. I tried putting - in front of bar_width but to no avail. Width will be dynamically calculated it's just that I want the direction to go to the left rather than to the right like so <------- not -----------> var bar_width=$(this).css('width') ; $(this).css('width', '0').animate({ width: bar_width }, queue:false,duration:3500,easing: easing}); You could animate it from right to left by animating both the margin-left and width of the

jQuery if statement depending on width in px

旧城冷巷雨未停 提交于 2019-12-05 21:05:19
I'm quite new to jQuery, could someone please tell me if I have expressed the above 'if' statement correctly? I basically want something to run if the width of my variable equals 900px. My variable is var $brewapp = $('#brewapp'); Thanks. if (($brewapp).width == '900px') { //what i want it to do } .width is a function, that returns a number. So your test should look like this: if ($brewapp.width() === 900) I suggest the Mozilla Javascript docs if you want to deepen your JS knowledge. You need to add only two characters: if ($brewapp.width() == 900) { //what i want it to do } I guess your code

Jquery width() function on chrome gives me different values on loading and reload(F5)

冷暖自知 提交于 2019-12-05 20:15:47
I dont what is going on but I have this menu set like this <div class="indice_item activo"> <div class="indice_item"> <div class="indice_item"> <div class="indice_item"> <div class="indice_item"> <div id="puntero" style="width: 180px; height: 19px; top: 70px; left: 0px; background-color: rgb(10, 173, 247);"> </div> The thing is that the div.puntero is a div that follows the mouse when it hovers over the different indice_item. I do this with jquery and its functions animate. When the page loads it creates this div.puntero, it looks for the first item of this menu and gets the width and the top