background-image

Page background image moves and stretch with collapsible set in jQuery mobile 1.4.0

泪湿孤枕 提交于 2019-12-08 01:59:10
问题 I have a Collapsible set in my jQuery mobile app , the problem is that when I added a background image for the Page as I expand , close the collapsible the background image is stretch and moves with collapsibles , When i removed these lines from my css : background-repeat: no-repeat; background-size: 100% 100%; this prolem has solved but this has caused another big problem which is that when I expand a collapsible and then close it the background will shrink " move to up with the collapsibe

How do I repeat part of an image using background-position and CSS sprites?

主宰稳场 提交于 2019-12-08 01:42:52
问题 I would like to create some buttons with dynamic width using CSS sprites and background-position but I'm not sure if what I want is possible.. I would like the button to have a left-side, middle, and right-side, with the middle repeating as required. Ideally I would like this to be made up of one image of 11px wide so the left and right sides are both 5px wide and the middle is 1px repeated. Is there some way I can define in CSS to use the one centre pixel of the image and repeat if for the

Prevent progressive (line by line) loading of background image

南笙酒味 提交于 2019-12-08 00:59:15
问题 I am looking for a way to have the background-images (CSS) load as if they were appearing once loaded, and not "rolling down". I'd rather have an image appear 300ms late in one flash instead of having it appear like a bad PowerPoint effect. Any techniques or specific code that could be used (besides caching)? Thanks, 回答1: First, if your image appear in "rolling down" it's Image it's too heavy. Exist different program or website for reduce your image for web ( without losing quality ) for

css background-image not working properly

为君一笑 提交于 2019-12-07 20:52:15
问题 i use exact this code: body { background-image:url('gradient2.png'); } found on w3 school its simple i got the pic in same folder, i did everything and i dont know why i cant insert images in css. The html tag is working. I had the same problem 3-4 months ago, and now working again with html and still, not working. The pic just wont show. this is my full css: * { margin: 0; padding: 0; } body { background: url("pagebg2.jpg") repeat left top; font: normal 10pt Arial,Helvetica,sans-serif; }

How to create a custom UIButton (with images) but still use setTitle?

社会主义新天地 提交于 2019-12-07 20:43:07
问题 I've tried creating a UIButton with UIButtonTypeCustom. Then afterwards used the following methods to adjust the look of it [sendButton setImage:[UIImage imageNamed:@"sendButtonOff.png"] forState:UIControlStateNormal]; [sendButton setImage:[UIImage imageNamed:@"sendButtonOn.png"] forState:UIControlStateHighlighted]; [sendButton setImage:[UIImage imageNamed:@"sendButtonDisabled.png"] forState:UIControlStateDisabled]; However the problem is, once you start setting UIImages to the states,

How do I make the style=“background-image: url()” in the html div go into css so that I could style it?

◇◆丶佛笑我妖孽 提交于 2019-12-07 18:33:48
问题 How do I make the style="background-image: url()" in the html div go into css so that I could style it? I tried putting it in different divs, but I keep doing something wrong. Since it's class is two words, I can't style that for some reason... Would I have to style it in html? Here is what I'm working with: <div id="home-slider" class="carousel slide carousel-fade" data-ride="carousel"> <div class="carousel-inner"> <div class="item active" style="background-image: url(images/logo.png)" >

Setting background-image using jQuery changes background only once

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 15:29:24
I'm trying to set background-image property of one element, depending on value of variable. It works only the first time. When I switch to ready, background image stops changing. Images themselves are small - around 8-10 kB. This is my code: if(status != '') { console.log('status'); console.log(status); switch(status) { case 'dev': $('#status').css('background-position','0px -160px'); break; case 'ready': $('#status').css('background-position','0px -240px'); break; case 'soon': $('#status').css('background-position','0px 0px'); break; case 'design': $('#status').css('background-position','0px

How do I convert a CSS background-position property from percentages into pixels?

拈花ヽ惹草 提交于 2019-12-07 10:32:48
问题 I'm centering a background right now (using background-position: 50% 50%; ), that I'd like to animate using Javascript. But, I want to be able to animate this using pixel measurements. Effectively I want to set the background-position to something like "50% + 10px". Is this possible using Javascript? I can possibly do it by finding the height of the background image and the height of the browser screen and do some arithmetic, but this seems like a convoluted solution. 回答1: In the future this

Background size with css with sprites

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 10:31:26
问题 I have a list and each <li> has an icon and a text. The image of icons is a sprite image, so I need to set the background-size of each li to have the size of an icon. How can I do this with CSS? 回答1: You can set the background image size in CSS3 like background-size: 32px 32px; but that is not really cross-browser compatible and I guess that is what your concern is. Unless the sprite is well spaced out and vertical, my recommendation would be to use a bit of extra markup. For example, use

Blitting a transparent .PNG image onto a screen

萝らか妹 提交于 2019-12-07 06:46:05
问题 Hi there I have a image with a black rectangle drawn on it, and its background is transparent. This file is saved as a png ( clear.png ). Then I have another image which is just a solid red background saved as a jpeg ( background.jpeg ). What I was trying to do is make so that the black rectangle in clear.png show up on top of the solid red background image. This is what I have done.. /*Transparent image*/ #include "SDL/SDL.h" #include "SDL/SDL_image.h" #include <iostream> using namespace std