w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
background color to persist with defined
CSS background color width reduces when browser window is resized
I think the best way to solve this is to add a minimum width to your body. This way when the viewport is too narrow to show all your content, a horizontal scrollbar will allow the user to access the entire page. By the looks of your content, min-width: 1100px; would be just about right.

Categories : HTML

Equalize height on two floating divs when window size is greater than specified width, then return to original height when window width is below
Working jsFiddle Demo Just remove height from elements: function originalHeight(group) { group.css('height', ''); }

Categories : Jquery

How to increase height of footer's div when browser window is resized?
I changed height to min-height AND changed .copyright div to .copyright { clear: both; text-align: right; margin-right: 20px; } So I get rid of float:right within .copyright and it worked!

Categories : CSS

easiest way to discretize continuous scales for ggplot2 color scales?
The solution is slightly complicated, because you want a discrete scale. Otherwise you could probably simply use round. library(ggplot2) bincol <- function(x,low,medium,high) { breaks <- function(x) pretty(range(x), n = nclass.Sturges(x), min.n = 1) colfunc <- colorRampPalette(c(low, medium, high)) binned <- cut(x,breaks(x)) res <- colfunc(length(unique(binned)))[as.integer(binned)] names(res) <- as.character(binned) res } labels <- unique(names(bincol(iris$Sepal.Length,"blue","yellow","red"))) breaks <- unique(bincol(iris$Sepal.Length,"blue","yellow","red")) breaks <- breaks[order(labels,decreasing = TRUE)] labels <- labels[order(labels,decreasing = TRUE)] ggplot(iris) + geom_point(aes(x=Sepal.Width, y=Sepal.Length, col

Categories : R

How can I make a div auto-adjust its height between two divs, according to window height using CSS/Javascript?
The correct way of ending <div> tag is by using </div>. Try this code- <body> <div style="position: fixed; top: 0px; left: 0px; width: 200px; height: 100%;"> <div style="float: left; height: 50px; width: 200px; background-color: green; position: fixed;"></div> <div style="float: left; height: 100%; width: 200px; background-color: red;"></div> <div style="float: left; bottom: 0px; left:0px; position: fixed; height: 50px; width: 200px; background-color: blue;"></div> </div> </body>

Categories : Javascript

Dynamically adjust div background-image when window is resized
use background-size:cover; or background-size:100% 100%; so your css will be :: .step-1-4 { background:url('../images/gadget-4-sprite.png') no-repeat; background-size:100% 100%; /*..or cover ...*/ width:950px; height:70px; margin-left: 15px; }

Categories : HTML

Why doesn't $(window).height() and $(document).height() equivalency work well in Firefox?
$(window).height(); will return the height of the visible window. $(document).height(); will return the height of the entire document, not just the visible part. Working Example That said, I don't think your specific issue is with the if statement... I tested it and it seems to work equally well in Firefox, Chrome, and IE9. Working Example 2 $(window).scroll(function () { if ($(window).scrollTop() +1 >= $(document).height() - $(window).height()) { $('body').css('background','red'); }else{ $('body').css('background','none'); } });

Categories : Javascript

Background Container Match Height of Inner Divs
Apply float:left; to the content class content { padding: 0 10px; background: #bbb; width: 820px; min-width: 820px; min-height: 100%; height: 100%; margin: 0 auto; float: left; } Example jsFiddle

Categories : HTML

jquery animate background color on scroll (multiple divs)
Include the JQuery file in your script, it will work. In your JSFIDDLE just change the framework and extension(left side) from "No Library(Pure js)" to "Jquery 1.6.4" and run the fiddle. See my comment to know why you can see the fading effect only when you scroll fast. You can use this javascript to see the fading effect when you reach the #contact div. $(window).scroll(function() { $("#about").stop().animate({ backgroundColor: $(window).scrollTop() > 200 ? '#000' : '#fff', }, 1000); if($(window).scrollTop() > 500){ $("#contact").stop().animate({ backgroundColor: $(window).scrollTop() > 500 ? '#fff' : '#000', }, 1000); } });

Categories : Jquery

How to get background color of a dialog/window?
http://qt-project.org/doc/qt-4.8/qwidget.html#palette-prop http://qt-project.org/doc/qt-4.8/qpalette.html http://qt-project.org/doc/qt-4.8/qpalette.html#ColorRole-enum QPalette::Window - 10 - A general background color. QPixmap::grabWindow(); can get you any part of the desktop. Hope that helps.

Categories : Qt

Div background larger than window height wont scale
Maybe you could use something like that: <div id="background"> <img src="img.jpg" class="stretch" alt="" /> </div> and than in css #background { width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; z-index: 0; } .stretch { width:100%; height:100%; } I dont know why you dont want to use css3, maybe you got some good purpose, but still I'd recommend to use that. css3 code is : background-size: 100%;

Categories : HTML

Jquery addClass works for width and height but not for background and color
Try !important if you already have css background for li .selected{ background: blue !important; color: yellow; height: 200px; width: 100px; } DEMO without important DEMO with important

Categories : Jquery

Columns with equal height and background color overflowing container
Once you have a div that is trapped inside of a parent container it is going to be difficult to get it to overflow horizontally. If you can get the div that you want to overflow outside of that container it would be best. If not, one way you can achieve this effect is using the :before and :after on the divs that you want to overflow. Basically you are giving them the same height and background-color and then position them to the right and left of the main div. .overflowing-div { position: relative; } .overflowing-div:before { content: ''; position: absolute; top: 0; left: 0; margin-left: -100%; width: 100%; height: 100%; /* or fixed height if you know the height of the div you want to extend */ background-color: #ccc; /* same color as .overflowing-div */ }

Categories : CSS

Setting the height and width of a background color behind a form element
What they most likely did what create classes for the items that are within the form element, and then in their .css file, they set the background color to the light gray color. You can see more about all this here: w3schools

Categories : HTML

WPF: How do I programmatically style my ListView so that all rows have a certain background color and height?
I figured it out. You can do it this way as an example: Style style = new Style(); style.TargetType = typeof(ListViewItem); style.Setters.Add(new Setter(ListViewItem.BackgroundProperty, Brushes.Pink)); listView.ItemContainerStyle = style; Edit: You can also conditionally set a style on the ListView's Items using a trigger for certain values from your data set. I found this very useful, so this may help others as well: DataTrigger trigger = new DataTrigger(); trigger.Binding = new Binding("Text"); trigger.Value = "This is a test."; trigger.Setters.Add(new Setter(ListViewItem.BackgroundProperty, Brushes.Pink)); style.Triggers.Add(trigger); listView.ItemContainerStyle = style; The above code will only set the background of the row under the condition that the Text field is set to "This

Categories : Wpf

Emacs: Set background color for specific window
Doing it for one specific window is not a feature Emacs supports right now. OTOH you can do it for a specific frame, so if your window is inside a frame with a single window (as is often the case for dedicated windows), you can definitely set the background-color frame-paramter (and should be able to set it directly from display-buffer-alist or special-display-regexps.

Categories : Emacs

Background should adapt to content height using JQuery on window resizing
Demo use display: inline-block. $(window).resize(function () { $("#background").css('display': 'inline-block'); });

Categories : Javascript

Height doesn't get updated when resizing the window
Thanks to Huangism for posting the duplicate thread, it was very easy to solve my problem. The solution is to use window instead of using the html element to get the height of the window. It seems like html doesn't get always updated. function UpdateLeftBar() { // Get the height of the window and minus the header and left top elements height = $(window).height() - 85 - 56; width = $('html').width() - 300; // Set the div to the new height $('#leftContentBottom').css({ 'height': height }); $('#middleContent.span10').css({ 'width': width }); console.log(height); } $(window).resize(function () { UpdateLeftBar(); });

Categories : Jquery

Scatterplot with X and Y axis color scales
Here you have a first approach using base graphics for your first problem (mixing two color gradients). ## use white->yellow for the x-axis and white->blue for the y-axis chooseColors <- function(x, y) { x <- 1-x/max(x) y <- 1-y/max(y) return(rgb(green=y, red=y, blue=x)) } ## example values for the whole range values <- expand.grid(1:100, 1:100) ## plot it plot(values, col=chooseColors(values[,1], values[,2]), pch=16) A more realistic toy example: set.seed(1) n <- 50 values <- cbind(sample(1:15, size=n, replace=TRUE), sample(1:15, size=n, replace=TRUE)) ## plot it plot(values, col=chooseColors(values[,1], values[,2]), pch=16)

Categories : R

How can we create a color scales for excel using R?
I think you need to write a macro inside your Excel workbook to allow dynamic changes based on the data you load into cells. Take a look at the last answer at http://social.msdn.microsoft.com/Forums/office/en-US/4998f97b-44c2-431a-bc91-138a94b12519/how-to-dynamically-set-a-cells-background-color-based-on-value-from-another-worksheet-in-the-same for one possibility. Here's another: http://www.mrexcel.com/forum/excel-questions/459520-dynamically-assigning-cell-rgb-background-color-using-contents-3-other-cells.html I haven't tried these out, so you'll have to play with them to see if they meet your needs. Edit: tripped across this SO question: Conditional Formatting using Excel VBA code Edit to respond to comment: @AbinasMishra I don't understand your comment. R cannot change the value

Categories : R

Floating divs goes down when page is resized
this is because the total width of all your inner divs get larger than the view port size when it is resized....thats why the last div is floating down when resized.try to express all width in percentage..i think this trick may work

Categories : HTML

Flexbox divs resized by image
The flexbox spec has gone through a number of changes over the last few years and various browsers have implemented different versions of the spec. It's unlikely you'll see much in the way of compatible behaviour at this point. In particular IE10 and Safari both have mostly working implementations of an old version of the spec. Firefox has recently implemented support but it is not enabled by default. In particular note that the original design of flexbox, based off the Mozilla CSS extension for XUL, was for distributing empty space, not re-sizing elements which already had an innate size. For this reason it may not be possible to achieve what you're aiming for in all browsers. If you're still interested in using flexbox in a real website check out Modernizr, specifically the tests f

Categories : CSS

change background color of window from data inputed from text field
I'm not familiar with titanium, but here's a couple of suggestions: function bgColour(colourData) { // do some transformations on the color data perhaps? // 1. We need to actually return the data: return colourData; } saveButton.addEventListener('click', function (e) { // 2. We need to get the value of the text field AFTER the saveButton // has been clicked, so this part of code is inside the event listener: var colourData = colourTextField.value; // 3. Mind the "style" and capital "C" in backgroundColor savedLocationsWindow.style.backgroundColor = bgColour(colourData); carLoggerTabGroup.setActiveTab(savedLocationsTab); });

Categories : Javascript

ListView background strangely scales
This was a bug in older versions of Android. The easiest way to work around this problem is to set the tile mode from code. After you create your ExpandableListView, simply get its background drawable and change the tile mode: View myListView = findViewById(...); ((BitmapDrawable) myListView.getBackground()).setTileModeXY( Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);

Categories : Android

Bootstrap grid divs overlap when the browser is resized
The #words div has the height set to a value of 122px. Since the fluid layout is reducing the width of the row, the text is getting "squeezed" down. The solution is to not set the height of the div, but instead include a "clearfix" <hr> element. This can be done by adding the following code to the #words div: <hr style='border: none; clear: both'>

Categories : Twitter

Set background color in Java on a JPanel doesn't work
This could fix it... public class Container extends JPanel { public Container() { super(); this.setOpaque(true); this.setBackground(Color.WHITE); } }

Categories : Java

Background-color doesn't stretch to fit the div using bootstrap on iPhone
I have entered your site. At first glance, the site has 46 warnings and 3 errors. Look at errors at css (open this on chrome, i.e - Tools for developers). Most of the warnings related to css, and I think you forgot "{" or something. Check that out. You should have (also for best practice) zero warnings & zero errors. Good luck!

Categories : Iphone

In Apache how do I redirect all traffic going to scales.ejiw.com to scales.ejco.com?
I believe the best way to go is with a 301 redirection. First of all because its search engine friendly and second of all cause its pretty easy to set up. The best way to this with Apache is to edit the .htaccess file in the document root of your server and add the following lines: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} !^newdomain.com RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] (Change the newdomain.com with your new domain of-course) This way is will redirect 'www' and non 'www' traffic. You can read some more about 301 redirections here.

Categories : Apache

calculate and set the height for some div (initial settings). When the height of the browser window is changed --> change the height for div
is that what you are looking for? api.jquery.com jQuery(document).ready(function () { $(window).resize(function() { var height = document.documentElement.clientHeight - 500; if (height < 135) { height = 135; } document.getElementById('left_space').style.height = height + 'px'; jQuery(window).resize(function () { var height = document.documentElement.clientHeight - 500; if (height < 135) { height = 135; } document.getElementById('left_space').style.height = height + 'px'; }); }); });

Categories : Javascript

Get resized image height with jQuery
Reading the attribute (with .attr()) will always return the original inline height attribute from the DOM. Use .height() instead (or .outerHeight() if needed). height = jQuery("#product-img-box img").height(); .height() Returns: Integer Description: Get the current computed height for the first element in the set of matched elements.

Categories : Javascript

IE10 hover pseudo class doesn't work without background color
looks like this can be fixed by using a transparent png as a background image. EDIT: sorry, shouldve expanded on this more. in ie, if you use the pseudo class of :hover on an element that has a transparent background color, the hover is only triggered when the mouse is over a solid/nontransparent spot. this is usually not an issue unless you are doing something like this: <style> #content { height:20px; overflow:hidden; position:absolute; width:100px; } #content:hover { height:100px; overflow:visible; } #hoverContent { position:absolute; top:20px; } </style> <div id="content"> <div style="float:left;">wtf</div> <div style="float:right;">hrm</div> <div id="hoverContent">lol</div> </div> in ie, if you

Categories : CSS

Actionbar fills transparent icon pixels with wrong background
Properties that you set on the theme will be inherited by EVERY view when the view resolves its styles. In your case, every view that doesn't have an explicit background set somewhere else will render an @color/cream background. This is bound to cause the kinds of visual problems you're experiencing, as well as creating massive amounts of unnecessary overdraw. A much better way to apply common styling to your fragments is to simply create a style <style name="Fragment"> <item name="android:background">@color/cream</item> </style> and reference it from the root view of each fragment, e.g. <LinearLayout style="@style/Fragment"> ... </LinearLayout> This means a bit of extra typing as the reference to the style needs to go into each fragment,

Categories : Android

How to obtain new height and width of resized image?
Depending on what it's you want to achieve, I would be tempted to add a method to the ImagePane called (something like) save... public void save(String path, String name) throws IOException { if (scaled != null) { name += scaled.getWidth() + "x" + scaled.getHeight(); ImageIO.write(scaled, "png", new File(path + File.separator + name + ".png")); } else { throw new NullPointerException("Scaled instance is null"); } } Take a look at Writing/Saving an Image You could also simply pass back a scaled instance based on the ImagePane's state... public BufferedImage getScaledInstance() { return getScaledInstanceToFit(bg, getSize()); } I wouldn't return the scaled object because you don't want people messing with it if you can help it...

Categories : Java

Allowing
background color/border-radius?
Set the background-color on the table element: table { border-spacing: 0; background-color: rgba(0,0,0,0.5); } td { border: 1px solid red; width: 75px; height: 50px; } http://jsfiddle.net/BnUU8/1/

Categories : HTML

Create three divs such that the top and bottom ones have fixed height, and the middle one has dynamic height?
If i understand you request you need to use wrap div: http://www.cssstickyfooter.com/using-sticky-footer-code.html

Categories : HTML

How to place a background-image that fills the entire screen but stops at a certain position from the bottom?
Why don't you just apply the stripe to a div surrounding your content; you could still have a background on the body tag and leave room for a 100px div at the bottom containing your logo: <body> <div class="content"> Content goes here. </div> <div class="footer"> Logo goes here. </div> </body> And then in your css: div.content { background-image: url(UI/img/stripe-stripe.png)!important; background-repeat: repeat-y !important; background-position: right -100px; background-color: #e6e2df !important; top:0; bottom:100px; width:100%; } div.footer { height: 100px; }

Categories : Javascript

Pictures moving when window resized
There's several ways you can do this. Without knowing all of the specifics I would recommend something like this. HTML: <div id="wrap"> <div id="left"><img src="#" /></div> <div id="right"> <div id="top"><img src="#" /></div> <div id="bottom"><img src="#" /></div> </div> </div> CSS: #wrap {min-width: 100px;} #left { width: 50px; float: left;} #right {width: 50px; float: left;} #top { width: 50px; } #bottom { width: 50px; } Just make sure the min-width on your wrap div is at least as wide as your images side by side. Working Fiddle: http://jsfiddle.net/6sFzk/2/

Categories : HTML

Automatically resize TableLayoutPanel row when window is resized
Change middle row to 100% percent, which will tell the system that middle row will fill any gap left. So change this (I believe its your designer.cs): this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); to: this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); Check TableLayoutPanel.RowStyle from MSDN: Rows with RowStyle set to Absolute are considered first, and their fixed heights are allocated. Rows with RowStyle set to AutoSize are sized to their contents. Remaining space is divided among rows withRowStyle set to Percent.

Categories : C#

Keep Contents of webpage from shifting when window resized
You'll have to give the div a left distance, if you want it to stay on a fixed place. Try adding: left: 1500px; Now when resizing your window, the div won't change position horizontally. To do the same vertically, you'll have to set a top too. Hope this helps!

Categories : HTML

How to position two elements inline even when the window is resized ?
2 elements inline can remain side side no matter rooms they have if you set on parent white-space:nowrap; Don't forget to reset white-space to normal for childs :)

Categories : CSS



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.