I've made the following website using Bootstrap to get my images responsive. When resizing in width the images are perfectly responsive. However, when resizing in height, the images don't resize.
What would be the best way to get this working?
http://bartoosterveer.nl/Jacowebtest/
Bootstrap works the responsiveness with the width, It assumes the height will have no relevance since you can scroll... if you want your images to resize width the height, but keeping the same width, it might distort the quality of the image.
Now, as for how to do It the only way I can think of right now is implementing some media Queries for some heights.
i.e:
#media (min-height: xxx px) and (max-height: xxx px)
{
#imageID
{
height: the height you desire for this range;
}
}
hope it helps
Related
I'm using the
Item.grabToImage()
But I'm getting the following error.
QML ItemX: grabToImage: item has invalid dimensions
This is because I'm using height and width properties like so:
width: {
// return with * 0.4; based for some condition
// for eg
return parent.width * 0.4;
}
// and something similar with height
The only time that I can get the following code working is when I put in a static heigth and width:
grabToImage(
function(result)
{
result.saveToFile("/path/project-name/tmp/something.png");
}
);
Any ideas of why and how do I get around this problem?
Thank you
I'm not a 100% sure why, But it was something about the dynamic width of the parent.
In the program I wrote I has set the anchors of the image to the left and right of the preview container.
So when I tried to get the image capture from another item that was overlaying the image to cut out smaller parts of the image it was not letting me.
How I fixed this was to set a fixed image size of the source image and then just anchor it to the center of the preview section.
The only thing is now it will not size up if you scale the window.
I'm sure I could implement and on size change to the main program window and then set the width of the image (Not tested).
Last thing I should mention is that if the image is small then the cut out images from sections of the source image will be blurry and not good quality.
I fixed this by setting the "sourceSize.width" to a very large image and then used the "scale" property to scale down the image to fit within the preview item.
I've come across this website: http://ethanmarcotte.com/ and when you scale the page down to tablet size, the logo which is Ethan Marcotte is in perfect ratio when the screen size gets bigger and smaller.
How would I go about replicating the same idea, having an image that is the same perspective no matter what screen resolution or what size the browser window is that it's being rendered on?
img {
max-width: 100%
}
If you want that this only happens at smaller resolutions you can add this and style the image between this.
#media screen and (min-width: 768px) {
}
If I have a high res image and use kinetic.image width and height attributes to scale it down I find that when I zoom in by using stage.setScale() the image is blurry compared to the original.
What are my options for zooming into an image on the stage so that it maintains its original crispness yet displays on the default 1:1 stage scale as smaller than the original resolution?
I have the same problem with it actually, but try to add css style to the canvas to override default behavior on how browser render the scaled image, it is not specific to kineticJS
canvas {
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
-ms-interpolation-mode: nearest-neighbor;
}
and this may be helpful too Disable Interpolation when Scaling a <canvas>
and here is the fiddle borrowed from above link http://jsfiddle.net/VAXrL/21/
please also refer to this question Resizing an image in an HTML5 canvas
I am making a responsive portfolio website using WordPress. I have a small issue that is breaking the layout. All images are meant to be 300px wide by 200px high.
I have also used the WordPress API to crop images if the user uploads images that are larger than the above mentioned dimensions
add_image_size( "portfolio", 300, 200, true );
What this does for me is that it inserts the width="300" and height="200" attributes to the images automatically (but the original dimensions of the image stay the same they are just being resized) This works well except when i try to resize my browser window..
Here is a senario: The client uploads an image with dimensions 300px wide and 210px high.. initially it is being resized and shown hence the layout is perfect but when i resize the browser the images gets resized as well but with respect to its "original dimensions".. hence the image with the original height of 210px is larger that the rest of the images.. and as i am floating all the images to form a 3 column layout the difference in height breaks the layout (shifting the column below this large image to the right and leaving an empty column below itself.)
How do i fix this issue? I thought of using timthumb to resize all images before they are display.. hence changing the original dimensions of the image on the fly but i think this is not an efficient way? Any other solution to this problem ? Also i dont want to using anything like jQuery Masonry as i have a specific layout to maintain.
Thanks
You can use the max-height rule from css to limit the height of all images equally.
eg:
.gallery img{
max-height: (some height);
}
Use % or em for the height, pixels might not work as well in a responsive design.
I'm targeting android but I don't know how to layout the UI so it works for all devices. How do I do this?
I have a TextField with a Button for searching and the search results are displayed below in a TableView below. So I have a table view but the bottom is cut off.
this.searchResults = Ti.UI.createTableView({
top:'70px',
height:'450dp'
});
As you can see from the code above I clearly dont know how to do this. How do you lay things out for android?
You can set top/bottom/left/right values. If you want the table to stop at the bottom edge of the screen, you could set bottom: 0. It's the same for iOS.
If I'm working on Android stuff, and I want it to resize proportionate to the size of the screen I often use percentages. So
this.searchResults = Ti.UI.createTableView({
top:'10%',
height:'90%'
});
Alternatively, If you want pin point accurate calculations, you can ask appcelerator for the platform width and height, and resize things proportionately yourself. Like so:
var height = Ti.Platform.DisplayCaps.platformHeight; //Screen height in pixels
this.searchResults = Ti.UI.createTableView({
top:'75dp',
height: (height - (75 * Ti.Platform.DisplayCaps.logicalDensityFactor)) //height - 75dp converted to pixels
});