width

jquery: image width on domready or load?

强颜欢笑 提交于 2020-01-05 06:28:34
问题 hey guys, I'm using the jquery data() method to store the width of images. When is jquery able to get the width of images. on-dom-ready or on-load? Is it necessary to have the images loaded to query it's width, or can i query the width on domready as well? thank you this is my piece of code: //Save the original image width $(".post-body img").each(function() { $(this).data('width', $(this).width()); }); 回答1: It depends, if you're specifying the width, then DOM ready works fine. If you're

How can I make my website width fit fully on iphone 5?

旧街凉风 提交于 2020-01-04 15:32:18
问题 I am working on a new site for my photography hobby. the ad is faspix.com i have got it to fit onto laptop/desktops how i would like but i am having an issue with making the width fit onto my iphone when i load the page on iphone the height is there fully but the width only shows about half from left to right then i have to scroll right to see the rest of the width...I have tried a bunch of different media queries but nothing has really solved the issue for example when i switched the site

Set button height equal to the button width

社会主义新天地 提交于 2020-01-04 04:38:06
问题 I've seen this question a lot on the internet, but all solutions didn't work for me.. So this is the problem. I want a button that has 50% width of the screen (that works fine). But now I want it to have the same height the as the width. Somehow this doesn't work: Button button1 = (Button) findViewById(R.id.button1); int btnSize = button1.getLayoutParams().width; button1.setLayoutParams(new LinearLayout.LayoutParams(btnSize, btnSize)); See this for the code: Activity1.java: package nl.jesse

How to create a histogram with varying bin widths

一世执手 提交于 2020-01-04 02:47:07
问题 I have been unsuccessful with other using hist plot. A simple problem would be using the following data: age range - frequency - central band width - bin width - height (respectively) 1-4 - 30 - 2.5 - 3 - 10 5-6 - 20 - 5.5 - 1 - 20 7-17 - 30 - 12 - 10 - 3 With age along the X axis, with a linear scale, so the bin width for 1-4 would be 3, with height 10, bin width for 5-6 would be 1 with height of 20, and 7-17 would be 10 and the height would be 3. How would can I place these data into a Word

Non-fixed width text in a static string - Jasper Reports

时间秒杀一切 提交于 2020-01-03 20:13:30
问题 So as I have learned since this post: How to stretch a text field relative to data width in Jasper Reports it is not possible to stretch the width of text fields. So I am trying to establish now whether it is possible to embed static text within a text field? I need to achieve a scenario something like this: "You're current employer [non-fixed width text] will contact you soon." Can anyone suggest a way to do this in Jasper? I'm all out of ideas. 回答1: You want a single Text Field with a value

how to make android seekbar full width in api 17 or above?

三世轮回 提交于 2020-01-03 15:59:52
问题 I want to make seekbar full width with no padding. I've seen this answer How to make SeekBar take up full width of parent but in api 17 and above it doesn't work. there is a padding in left and right of seekbar. how do i remove this padding? 回答1: I just set padding at run time and it's OK now! musicSeekbar.setPadding(0,0,0,0); 回答2: You can make it work using XML (API 17+): android:paddingStart="0dp" android:paddingEnd="0dp" 回答3: you can use a parent layout before your seekbar's layout and put

YUI - Get True element width?

拟墨画扇 提交于 2020-01-03 12:24:27
问题 I am using YUI and need to get the true width of the element. The width of an element can be determined as follows. width + border-left + border-right + padding-left + padding-right + margin-left + margin-right. Below is what I have come up with. It appears to be working. I was just wondering if this is the best way to go about determining this or is there there a more efficient way? YUI().use('node', function(Y) { var node = Y.one('#nav'); var nodeWidth = trueElementWidth(node); alert

Prevent text from expanding shrink wrapped div

余生颓废 提交于 2020-01-03 11:35:15
问题 I have a holder div that's shrink wrapped around a couple other divs, so the holder doesn't have a set width. Also inside the holder is another div that contains text. When there's too much text it's expanding the holder so it's not shrink wrapped anymore. Here's a demo of my problem, http://jsfiddle.net/WSbAt/. This is for a photo gallery page. I'm thinking there might not be a way without setting the width of the holder, which I can't do since the number of images per row is dynamic. I can

HTML Table column width practices

穿精又带淫゛_ 提交于 2020-01-03 06:53:31
问题 What are good practices when selecting column widths in a table? Let's say I have four columns, name (variable width), description (long content of text), count (max 3 chars), date (fixed format). What would be a good practice? I'm thinking fixed width for descr., count and width (thus actually also making name "fixed" width). But my real question is, how to select a particular width size. For instance, if the date format is yyyy-MM-dd is there some trick to convert those 10 chars to a width

fancybox width doesn't apply

[亡魂溺海] 提交于 2020-01-02 22:14:06
问题 I'm trying to set up a width for the fancybox $("a.loader").fancybox({ width: 1000, height: 1050, autoDimensions: false, maxWidth : '100%' }); Read some topics, but set up autoDimensions: false, , tried to set width with px and without it, with commas and without it. Nothing help, the fancybox appears with the same widht and height. What is the issue? P.S. jquery-1.8.2.min.js and jquery.fancybox.pack.js (downloaded 2 to 3 weeks ago) if that's the case. Just added: Also, there are NO