w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Nivo slider adjusting the height of the main image
I didn't really fix it but I found a workaround. I took off the bottom 20 or so px from my images and found that re sizes appropriately this takes away some info but hopefully it will be ok, here's to hoping the boss will like it!

Categories : Javascript

jQuery - get tallest image's height, apply other images' height difference to top margin
Try this: function createGrid() { var imgs = $('.hlist figure > img'); var maxImgHeight = 0; imgs.each(function () { var imgHeight = $(this).outerHeight(); maxImgHeight = maxImgHeight > imgHeight ? maxImgHeight : imgHeight; }); imgs.each(function () { var margin = maxImgHeight > $(this).outerHeight() ? (maxImgHeight - $(this).outerHeight()) : 0; $(this).css("margin-top", (margin + "px")); }); } The first each loop looks for the tallest height and stores it in maxImgHeight, as you originally had planned. The second each loop calculates and applies the margin for each image. The conditional assignment will cause the margin-top for the tallest image to be 0.

Categories : Javascript

How to prevent text from going below an image when the height of text exceed the height of the image?
Try float:left on the image and float:right on the text like: .eventphoto { padding:1px; width:200px; float:left; margin-right:15px; border-radius:2px; } .desc { font-size:0.8em; line-height:13pt; float:right; }

Categories : HTML

Setting UITableViewCell height and the cell's text label based on the text height
I think that the problem might be of adjusting the vertical alignment of the text in the UILabel instance. I think you should do the following inside cellForRowAtIndexPath: cell.infoLabel.text = _content[[indexPath row] * 2]; cell.infoLabel.numberOfLines = 0; [cell.infoLabel sizeToFit]; More details about it can be found in the following link: Vertical Alignment of UILabel Text Hope this helps! :)

Categories : IOS

CSS height adjusting
Fieldsets automatically adjust in height to contain the form elements contained within. No additional CSS is required. The fieldsets must contain form fields obviously; not 100% sure why you've omitted them from your example code.

Categories : CSS

force div height to nearest multiple of the background image height
Here's asolution to your problem. It will expand the content container to the next height that is a multiple of 300. Plain JavaScript version var e = document.getElementById('content'); var height = e.clientHeight; var newHeight = 300 * Math.ceil(height / 300); e.setAttribute('style', 'height: ' + newHeight + 'px;'); Demo Try before buy jQuery version var e = $('#content'); e.css('height', 300 * Math.ceil(e.height() / 300)); Demo Try before buy

Categories : Javascript

Adjusting D3 Chart Bar Height
Here is a working example with some corrected code: http://tributary.io/inlet/5767993 (You can click on any number and change it with the slider to see it's effect on the output) I think the main issue was that the scale factor needed to be applied to both the "y" attribute and the height attribute.

Categories : Javascript

Android - Bitmap Height = Textview Text Height?
Try using ImageSpan(resizedbitmap, ImageSpan.ALIGN_BASELINE) instead of ImageSpan(resizedbitmap) The default alignment of an ImageSpan is ALIGN_BOTTOM.

Categories : Android

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

UITableCell Height not adjusting properly
You can use CGSize maximumSize = CGSizeMake(300, 9999); NSString *myString = @"This is a long string which wraps"; UIFont *myFont = [UIFont fontWithName:@"Helvetica" size:14]; CGSize myStringSize = [myString sizeWithFont:myFont constrainedToSize:maximumSize lineBreakMode:self.myLabel.lineBreakMode]; to calculate the displaying size of a givin NSString. So you can alter your cell's height according to the codes above. And also, you should reload your tableview after the heigth of some cell is changed.

Categories : IOS

In short, no. An absolutely positioned item is outside of the standard document flow and will not be able to affect the height of any parent element, nor will it be able to change the location of any siblings. You could theoretically do this with Javascript if you need to keep the <li>'s position: absolute;

Categories : HTML

Javascript / jQuery - Is there a performance difference between height() and .css({'height'})
Read the Source, Luke. jQuery.prototype.height: //snipped to end: return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); jQuery.prototype.css: return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); The difference between the two is what's done before going over the matched elements, and that extra parameter that's passed in .height. What could rationally cause a big slowdown? I've no real idea. Maybe it has to do with optimizations a js engine can do in one, but not the other. More likely than not, the perf test is bad (testing these things correctly is very ha

Categories : Javascript

jQuery Error: Object has no method 'height', this.height()
this is a DOM element. You want a jQuery object. Try $(this).height() : function Test(){ $("#list li").each(function(){ var h = $(this).height() + 50; $(this).height(h); }); }

Categories : Jquery

jQuery Set height of 2 independent lists first list li the same height as second li
http://jsfiddle.net/EvspT/ $(document).ready(function() { $('.extraQuestionName li').each(function(i) { $('.extraQuestionValue li').eq(i).height($(this).height()); }); }); The each() function has an index parameter. This loops through the li elements in the first list, and uses eq() to find the item with the same index in the second list, then set the height.

Categories : Jquery

Issue automatically adjusting the height inside a Extjs 4.2.1 viewport
Like Thomas said, the example you link to works only because the the items are located in the viewport directly. The viewport is using border layout. Your rqstPanel is a subitem of a panel, and that panel is then in the border layout. So when the rqstpanel is collapsed it's parent, the panel, is not collapsed. So the example has this hierarchy: Viewport (layout: 'border') - Panel (north) - Panel (center) - Panel (south) When fxp the center panel is collapsed, the layout of the viewport will resize the siblings to fill the available space. You have this: Viewport (layout: 'border') - Panel (north) with content 'some html' - Panel (center) - Panel rqstPanel - Panel (south) - Panel rsltPanel This is due to the default xtype is 'panel' and you add rqstPanel as a child of th

Categories : Javascript

jQuery, min-height based on browser height
Use css(). var height = $(window).height(); $(".single-block").css("min-height", height); or simply: $(".single-block").css("min-height", $(window).height());

Categories : Jquery

How to position text appropriately under an image independant on the height of the image
The best way to do this is to emulate a table layout with divs and CSS. This works without having to have an absolute height for anything. See this demo. HTML: <div class="container"> <div class="row"> <div class="cell"> <img src="http://dummyimage.com/200x300/000/fff" /> </div> <div class="cell"> <img src="http://dummyimage.com/200x200/000/fff" /> </div> <div class="cell"> <img src="http://dummyimage.com/200x100/000/fff" /> </div> </div> <div class="row"> <div class="cell"> Text </div> <div class="cell"> Text </div> <div cla

Categories : Javascript

Value height image on mouseover bigger than image height
I think it happens when the picturebox is bigger than a image. Try this: Int32 h = picture.Height; Int32 w = picture.Width; if (e.X < w && e.Y < h) { Int32 R = picture.GetPixel(e.X, e.Y).R; Int32 G = picture.GetPixel(e.X, e.Y).G; Int32 B = picture.GetPixel(e.X, e.Y).B; lbPixelValue.Text = "R:" + R + " G:" + G + " B:" + B; lbCoordinates.Text = String.Format("X: {0}; Y: {1}", e.X, e.Y); } else { lbPixelValue.Text = ""; lbCoordinates.Text = ""; }

Categories : C#

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

Jquery get height of fluid image
You can use window resize callback $(window).resize(function(){ var img_height = $('#image').height(); $('.some_div').css('height', img_height); })

Categories : Javascript

Javascript / jQuery : get height when max-height is set to 0
My first question would to be why are you using max-height: 0; is there something else you can use? Like hide() show() which use display: none the only thing I can thing of would be to remove the max-height css get the height and then reapply the max-height: $('.div').css('max-height', 'none') console.log($('.div').height()) $('.div').css('max-height', '0') This should happen fast enough that you wont see the element but it could be wise to hide it before removing the max-height with: $('.div').hide() $('.div').css('max-height', 'none') console.log($('.div').height()) $('.div').css('max-height', '0') $('.div').show()

Categories : Javascript

jquery .height() not pulling the height
If you want a one-liner, try this: $(".zebra-helper").fadeToggle("slow", "linear").height($("#main-content-pane").height()); If you want to use again the same height in that block, store it into a variable, then use it when needed: var h = $("#main-content-pane").height(); $(...).height(h);

Categories : Jquery

Jquery Expand Height with text overflow
Remove your heightfix jQuery and css code (it isn't really necessary in this situation) and change height:30px; to min-height:30px;. Working fiddle - http://jsfiddle.net/sqGkg/

Categories : Jquery

jQuery returning wrong height value for image in some environments
Change this: $(window).resize(function() { size_carousel(); }); $('#myCarousel').ready(function(){ //ready event is only for document! size_carousel(); }); To that: $(window).on('resize load',function() { size_carousel(); });

Categories : Jquery

Click to increase height and decrease back to original height when click again with jQuery?
$("button").toggle(function(){ $("#section").height($("#section").height()+300); },function(){ $("#section").height($("#section").height()-300); }); reference toggle

Categories : Jquery

How to reduce length of white dash line so it matches image and text height?
Just try setting margin for img to a little lesser value and setting margin and padding for all the rest elements to 0. Check this Fiddle Setting img { margin: 0.1em 0; max-width: 100%; float:left; } Adding this to css * { margin: 0; padding: 0; } did the trick for me as of now. But it will all depend on the height of image. After setting this margin property if the height of image is greater than the text than div height will expand and so will the webkit line. This is by far the manual solution to your issue, but there are many other ways of achieving this, just try to change your approach for a more dynamic solution.

Categories : CSS

jQuery, dynamically download image: IE doesn't know its width and its height
I did it once like this //set image's src here var $pomImg = new Image(); $pomImg.src = $src; $pomImg.onload = function(){ initTest(); //do something here (maybe load second image the same way) } if($pomImg.complete == true){ initTest(); //do something here }

Categories : Jquery

jquery Checking Image Height width server issue
I believe it's because JSFiddle automatically wraps your code in a $(document).ready() ( or maybe $(window).load() ). In your actual code, you need to do this yourself. ie $(document).ready(function(){ //All your jQuery code here });

Categories : Jquery

jQuery To Make Coumns Same Height - After Font/Text Change
Okay, I actually finally figure out what I needed. The final code looks something like this: // Reset max height for each class var intMaxHeight = 0; // We MUST remove all heights from the various DIV elements // NOTE: If we don't do this then the height will stay the same no matter what // after the first call - it will just stay the same as the first intMaxHeight $(".content-box-content").each(function() { $(this).css("height", ""); }); // Set the max height of the tallest column $(".content-box-content").each(function() { if (intMaxHeight < $(this).height()) { intMaxHeight = $(this).height(); } else { intMaxHeight = intMaxHeight; } }); // Set all columns to the height of the tallest column $(".content-box-content").each(function() { $(this).

Categories : Jquery

whats wrong with this code? im trying to change the height of each section to the height of window
Seems like a strange way to do that ? $(window).on('resize load', function() { $('#home, #about, #skills').height( $(this).height() ); }); You have to update the variables when the window changes size, i.e. inside the resize function EDIT: You'll also need a DOM ready handler, and window.onload isn't always triggered when doing it that way, so just do the same thing on DOM ready, like so : $(function() { $('#home, #about, #skills').height( $(window).height() ); $(window).on('resize', function() { $('#home, #about, #skills').height( $(this).height() ); }); }); FIDDLE

Categories : Javascript

HTML table with 100% of height, and the rows equally divided in height. How to make it possible?
You can position the table absolute. For example, give it the class "full-height", and then add the following css: table.full-height { position: absolute; bottom: 0; top: 0; left: 0; right: 0; } This will expand the table to the full height!

Categories : CSS

TD cell with css decimal percent height gets incorrect actual height in Chrome
This might be a bug in Webkit based Browsers. But you unnecessarily confuse the table algorithm ...! Why would or should you set the height of each TD explicitly when the table algorithm will do it by itself? So the easiest way to avoid the problem is to simply set no height for the TDs. See the updated jsFiddle: http://jsfiddle.net/RUwLH/4/ ... From a semantically point of view your code is highly questionable, and giving each of the elements the same class is also very inefficient CSS (hope you just did it for the Fiddle). After all these years tables are still a "special problem" ...! So only use them for tabular data and nothing else! HTML and CSS provide a lot of other possibilities which are even more semantically!

Categories : HTML

Display 3-column layout with variable-height content in fixed height box?
Using just CSS, columns appear to be the best way. demo HTML Each tweet is just a pair of <strong> usernames, and <p> tweet bodies. Change these to whatever you like, but make sure to change the CSS to match. <div class="threecol"> <strong>@someone</strong> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae.</p> <strong>@nextuser</strong> <p>...</p> </div> CSS This CSS is for the container. Other than your specificiations (width, height, hidden overflow) it just adds the column settings. .threecol { height: 200px; width: 600px; margin: auto; overflow: hidden; -webkit-column-count: 3; -moz-column-count: 3; col

Categories : HTML

One div fixed height and another div remaining vertical space to make it 100% of window height
Do you want to this apply this css it matching your requirement body, html { min-height: 100%; } #container { margin: 0 auto; height: 400px; width: 400px; padding: 0px; border:1px solid #ccc; } #div-a { height: 16%; width: 96%; float: left; margin: 2%; background: #ddd888; } #div-b { float: left; min-height: 78%; width: 46%; margin: 0% 2% 2% 2%; background: #bbb; } #div-c { float: left; min-height: 78%; width: 48%; margin: 0% 2% 2% 0%; background: #000; } and html its help full for you <div id="container"> <div id="div-a"></div> <div id="div-b"></div> <div id="div-c"></div> </div>

Categories : HTML

css floating element increase parent height but sibling with 100% height not working
Jquery solution, here's a Fiddle $(function() { var fHgt = $('#float').outerHeight(); $('#fill').css({ height: fHgt }); }); and here's a CSS solution #container { display: table; width: 500px; background-color: yellow; } #float { display: table-cell; width: 20%; background-color: green; } #fill { display: table-cell; width: 80%; overflow: hidden; background-color: red; }

Categories : HTML

issue with setting min-height for a div before website load based on device height
in order to use a percentage height, the parent must have a set height (either in pixels or %): body,html{ height: 100%; } .container-fluid{ background:#000000; width:100px; min-height:50%; } Fiddle

Categories : Javascript

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

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

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

Responsively changing an elements height to the view port height in pixels
My solution uses a combination of simple jQuery and some basic css declarations, the jQuery is cross browser as far as I can tell however I have noticed the CSS does not play well with IE<9. If anyone has any other solutions/more efficient ideas let me know! (yes I realize this is not incredibly memory efficient as it runs a loop, but so far my tests have not deemed it noticeable) The CSS can be seen in the jsbin example, it is pretty simple. Keep in mind this solution should only be used if percentages will not work for your height. function ChangeElementHeight(element){ var Element = $(element);//this is the elements whos height needs changes var ElementHeight = Element.css('height');//the current height of the element var ViewportHeight = $(window).height()+"px";//le w

Categories : Javascript



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