background-image

How to position a background image in reveal.js?

前提是你 提交于 2019-12-03 16:32:30
问题 I want to have a background image on the right hand side of one slide in a reveal.js presentation. I added the image to the slide like this: <section data-background="myImage.jpg"> // content </section> How can I add css styles to make it appear on the right edge of the screen? 回答1: This article helped to find the solution. You can add a style to the html element for the current section using data-state="something" and of course you can use that style for tweaking your css. So I used this

how to fit the plot over a background image in R and ggplot2

帅比萌擦擦* 提交于 2019-12-03 15:32:58
I am trying to fit the plot that is displayed over the background image. I cannot stretch the image too much because of the loss of sharpness. Therefore, I have to fit the plot over the background image which is much thinner than the plot. I do not know how to do it. Please see the attached plot: Here is the sample R Code: library(ggplot2) library(readxl) library(jpeg) library(grid) # find the ".jpg" image files and parse them to get the depth ranges for each image setwd('~/R/Image_Example') image_file <- "C1_9195-9197.jpg" # read in the image file img <- readJPEG(image_file) g <- rasterGrob

add background image to android ListView using Picasso

你离开我真会死。 提交于 2019-12-03 15:12:24
I need to add a background image to a ListView. Normally I would call listview.setBackground(myImage) . But the image is coming from server and so I need to use Picasso to load the image into the background of my ListView. How do I do that? Option One Define an anonymous subclass of com.squareup.picasso.Target Picasso.with(yourContext) .load(yourImageUri) .into(new Target() { @Override @TargetApi(16) public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { int sdk = android.os.Build.VERSION.SDK_INT; if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { yourListView

CSS background stretches to fill height in iOS but there is white space on scroll

北城余情 提交于 2019-12-03 14:14:52
问题 this CSS gets my background to fill 100% of the screen height in iOS but there is a minor problem - when you scroll down there is initially white space, then when you release your finger and stop scrolling the background image "adjusts" and fills 100% of the screen height again. The problem does not re-occur on the same page if you continue to scroll, just the first time. Could someone please help? Thanks #background { background: url(../img/background.jpg) center repeat-x; position: fixed;

CSS background-position animate right to left

好久不见. 提交于 2019-12-03 13:14:06
I'm trying to animate a background-image, so that the image appears from right to left. I have used an image which has a greater width than the div-container, where the background is located. On start, the backgrond is the following background: url(../img/zeppelin.png); background-repeat: no-repeat; background-position: right; but when the page is loaded, I want the background to be animated, so that it is positioned left. This should take a eg. 2 seconds and only should be done one time. (the image should be positioned left afterwards). I don't wanna use any mouse-events or pseudo-classes. Is

CSS Background Image Not Displaying

北城以北 提交于 2019-12-03 09:30:46
I have an HTML file with a subdirectory called img with an image called debut_dark.png . In my CSS file, I have: body { background: url(/img/debut_dark.png) repeat 0 0; } The HTML file has the body tag and does include the CSS file appropriately. I know for sure the CSS file is included properly as everything else is formatted properly. The background image is not getting displayed, I am only seeing a white background. Any ideas how to fix this, or even how to debug it? SaidbakR According to your CSS file path, I will suppose it is at the same directory with your HTML page, you have to change

How to verify background (css) image was loaded?

大城市里の小女人 提交于 2019-12-03 09:08:47
问题 I have the following CSS class .bg { background-image: url('bg.jpg'); display: none; } that I'm applying on a TD tag. My question is how can I tell with JavaScript/jQuery that the background image finished loading? Thank you. UPDATE: added display property. Since my main objective it toggle it into view. 回答1: The only way I know of to do this is to load the image using Javascript, and then set that image as the backgroud. For example: var bgImg = new Image(); bgImg.onload = function(){ myDiv

A way to create random-noise background image (png) with javascript?

半腔热情 提交于 2019-12-03 07:59:53
The new layout of YouTube added a background random-noise which I like very much, having seen almost exactely the same effect on other sites, so I plan to use the same technique in my webpage prototypes, or at least have this "trick" in my toolbox for future use. The image is like this (taken from http://g.raphaeljs.com/barchart.html ): Now Youtube accomplishes the (embarrassingly identical) same effect by embedding the image in source code: (on Youtube main page, right click background to display it, then right click the image and "display image properties" [ffox]): data:image/png;base64

Using Raphael JS, fill an SVG element with with a background-image with an offset

自闭症网瘾萝莉.ら 提交于 2019-12-03 07:42:10
问题 I want to this this Fill SVG element with with a background-image with an offset, but using Raphael JS. Displaying an rectangle with a background image without the offset is easy. canvas.rect( positionx, positiony, width, height ).attr( {fill: "url('/content/image_set.gif')"} ); The code above will display only the upper-left corner of the image. I want to shift it and display another part of it. How can I do it? 回答1: I'd suggest drawing the image separately from the rect. If you need the

Resizing background sprite image to fit div

☆樱花仙子☆ 提交于 2019-12-03 07:18:58
问题 I am creating a card game . I have a sprite image of cards . Say in the sprite , each of the cards is 50px wide and 80px high . Now I have some divs where I want to place these cards . Say the Divs are 100px wide and 160px high . I have using the first image as a Sprite for the Divs like in the below. background: url(../images/poker_sprite.gif) no-repeat scroll 0 0 transparent ; I vary the x and y positions so that different divs get diff cards . What CSS property do I use to make the