• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Stretchy Background Image

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Old Nov-29-2011, 01:18 PM
#1
Smug Eric is offline Smug Eric OP
Smug Hero
Smug Eric's Avatar
Stretchy Background Image
So I was working with someone on their site today who wanted to have a single image stretch to fit whatever browser window. After some tinkering I found a rather simple way to make this work. (until CSS 3 is implemented in all browsers that is)

In your CSS:

Code:
#bgImg {
  position:fixed;
  width:100%;
  height:100%;
  top:0;
  left:0;
  z-index:-1;
}

In the Body Tag:

Code:
<img src="www.imageurl.com/photo.jpg" id="bgImg" />
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help

Last edited by Smug Eric; Mar-14-2013 at 12:48 PM. Reason: The test page was changed
Old Dec-02-2011, 11:18 PM
#2
itsdouet is offline itsdouet
Beginner grinner
Hi, how about the gray background behind the slideshow? I can't get rid of it. http://itsdouet.com

Thank you for your help!
Old Dec-02-2011, 11:20 PM
#3
urbancowboy0914 is offline urbancowboy0914
Major grins
urbancowboy0914's Avatar
Quote:
Originally Posted by itsdouet View Post
Hi, how about the gray background behind the slideshow? I can't get rid of it. http://itsdouet.com

Thank you for your help!
Check where you last posted this question. I have answered it for you.
__________________
Nick

Photographer: Katherine Stathes
Web Designer: USMC Cpl Coffman, Nicholas J
http://www.stathesquo.smugmug.com
Old Dec-07-2011, 08:17 AM
#4
LJ2b2c is offline LJ2b2c
Major grins
Eric,

I only wanted this on my home page and certain categories. I came up with this to make it work, but is there a cleaner or easier way to do this?

/* Background */
#bgImg {
position:fixed;
width:0%;
height:0%;
top:0;
left:0;
z-index:-1;
}

.homepage #bgImg {
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}
.category_Football #bgImg {
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}
.category_Basketball #bgImg {
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}
__________________
http://millerpics.smugmug.com/
Old Dec-07-2011, 03:02 PM
#5
Smug Eric is offline Smug Eric OP
Smug Hero
Smug Eric's Avatar
you could do this instead:

#bgImg {
display: none;
}

.homepage #bgImg, .category_Football #bgImg, .category_Basketball #bgImg {
display: block;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help
Old Dec-08-2011, 04:54 AM
#6
LJ2b2c is offline LJ2b2c
Major grins
Yep, that looks much better. My solution seemed to be asking for problems.

Thanks,
__________________
http://millerpics.smugmug.com/
Old Dec-27-2011, 09:34 AM
#7
LJ2b2c is offline LJ2b2c
Major grins
FYI, I expanded on the above to allow for the customization of the background on individual Share pages. With this, by changing the url in the Share description, you can make the background of each share different. In the Share Description I put something like;

<img src="your url here" id="sharebg" />

Add <HTML> tags if required

Shares without anything like this in the description are unchanged from the default.

Then I added the following to CSS;

#sharebg {
display: none;
}

.shareHomepage #sharebg {
display: block;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}


Customization of Share Groups is not easy, but this may help.

Larry
__________________
http://millerpics.smugmug.com/
Old Dec-27-2011, 09:44 AM
#8
LJ2b2c is offline LJ2b2c
Major grins
Here is a link to one I'm working with;

http://millerpics.smugmug.com/share/Video



The description for this Share Group is as follows;

<html>
<img src="http://millerpics.smugmug.com/photos...-5tXzScW-L.jpg" id="sharebg" />


<center><img src="http://millerpics.smugmug.com/photos.../i-VGsmM96.png"
height="133"
width="743"></center>
<BR>
<div id="navcontainer4">
<ul>
<li><a href="/"><font color=#ffffff><strong>Miller Home Page</strong></font></a></li>
<li><a href="http://millerpics.smugmug.com/Other/...6_EXr7m"><font color=#ffffff><strong>Jordan Family Photos</strong></font></a></li>
<li><a href="http://millerpics.smugmug.com/Other/...7_BVRUW"><font color=#ffffff><strong>Secure Galleries</strong></font></a></li></ul>
<BR>
</div>
</html>
__________________
http://millerpics.smugmug.com/
Old May-30-2012, 09:49 AM
#9
dclphoto is offline dclphoto
Big grins
dclphoto's Avatar
Quote:
Originally Posted by Smug Eric View Post
So I was working with someone on their site today who wanted to have a single image stretch to fit whatever browser window. After some tinkering I found a rather simple way to make this work. (until CSS 3 is implemented in all browsers that is)

In your CSS:

Code:
#bgImg {
  position:fixed;
  width:100%;
  height:100%;
  top:0;
  left:0;
  z-index:-1;
}

In the Body Tag:

Code:
<img src="www.imageurl.com/photo.jpg" id="bgImg" />
You can see it in action here with a crappy photo of my dog in my hoodie:

http://erictest.smugmug.com/

Feel free to drag the borders of your browser around to make my dog get that fun house mirror look.


I am trying this and I typed this into the Body Tag (the green type is the name of the image):
<img src="www.dclphoto.com/image2.jpg" id="bgImg" />

Nothing appeared to happen, so I tried this in the Body Tag:
<img src="www.dclphoto.com/photo.jpg" id="bgImg" />

Neither is creating a full spread of the image across my screen. Any suggestions as to what I am doing incorrectly?
Old May-30-2012, 01:29 PM
#10
Smug Eric is offline Smug Eric OP
Smug Hero
Smug Eric's Avatar
You need the actual url of the image. Go into the gallery you have uploaded it to. Select the Share ~> Get a Link option and get the largest one there. Paste that into the quotations.
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help
Old May-31-2012, 06:47 AM
#11
dclphoto is offline dclphoto
Big grins
dclphoto's Avatar
Thank you! That did work, but it only stretched my image horizontally. Is there a way to stretch it and keep in in proportion to avoid distortion of the image?
Old May-31-2012, 02:50 PM
#12
Smug Eric is offline Smug Eric OP
Smug Hero
Smug Eric's Avatar
I'm not seeing the code for it on your site.
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help
Old Jun-01-2012, 11:42 PM
#13
dclphoto is offline dclphoto
Big grins
dclphoto's Avatar
Quote:
Originally Posted by Smug Eric View Post
I'm not seeing the code for it on your site.
I removed it because I didnt want it seen by visitors. The distortion is less appealing than the smaller background. Do I need to apply for you to investigate?
Old Jun-02-2012, 04:23 AM
#14
denisegoldberg is offline denisegoldberg
Major grins
denisegoldberg's Avatar
Quote:
Originally Posted by dclphoto View Post
The distortion is less appealing than the smaller background.
Keep in mind that as the viewer changes the size of the browser window the image will distort - unless Eric has a different method to try here. You can see that by changing the size of the window using the sample link from the first post.

--- Denise
__________________
http://www.denisegoldberg.com ... http://denise.smugmug.com

Musings & ramblings at http://denisegoldberg.blogspot.com, quick posts in google+
Old Jun-02-2012, 07:47 AM
#15
dclphoto is offline dclphoto
Big grins
dclphoto's Avatar
Quote:
Originally Posted by denisegoldberg View Post
Keep in mind that as the viewer changes the size of the browser window the image will distort - unless Eric has a different method to try here. You can see that by changing the size of the window using the sample link from the first post.

--- Denise

OK. So is there a way to enlarge the background image and have it accomodate according to the browser? If not, I will just leave it as is. Wasted space on the side gutters is the better of two evils I guess.
Old Jun-05-2012, 01:50 PM
#16
Smug Eric is offline Smug Eric OP
Smug Hero
Smug Eric's Avatar
I've only seen the fixed size or the stretchy hack I came up with here. But if you don't want it to distort you can choose to remove either the width: 100%; or height: 100%; lines. If the code is only expanding it on one dimension then they could be some blank space at the bottom or at the sides of the page depending on which you remove. But with that the image would not distort.
__________________
Eric
Support Hero and Customeister
http://www.smugmug.com/help
Old Jun-30-2012, 03:45 PM
#17
Weather Nerd is offline Weather Nerd
Big grins
Weather Nerd's Avatar
You, Denise and the whole SM crew rock! Denise, I did a little tweaking in photoshop to allow for some stretch and increased pixel size. I'm not sure how well it help, the largest monitor I have is 17'. Thank you guys for your help. My light bulb clicked on too. What if I wanted to put a .gif? I tried with one my test vids and it loaded, but didn't play. I'm a real dummy when it comes to code, but I have downloaded the 50 page CSS tut. Thank you all for sharing what code you have written.

Again, you guys rock!

Chad
Old Nov-24-2012, 04:24 AM
#18
tobeme is offline tobeme
Major grins
tobeme's Avatar
I used this code on my site but the image is shown as a 'header' instead of as a background image.

I took out the image url for now.

Here is my site: www.wallacehuo.info
Old Feb-27-2013, 02:55 AM
#19
G and E is offline G and E
Big grins
Got it, but now dropdown fails.
Quote:
Originally Posted by Smug Eric View Post
you could do this instead:

#bgImg {
display: none;
}

.homepage #bgImg, .category_Football #bgImg, .category_Basketball #bgImg {
display: block;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
z-index:-1;
}
Ok, so I got the full-sized stretchy on the homepage only, but now the dropdown menu on my homepage doesn't work. It works fine on all the other pages, so it must be something with the image - any idea what it could be?

Elan
Tell The World!  
Similar Threads Thread Starter Forum Replies Last Post
How To Maximize Your Findability (Search Engine Stuff) Andy SmugMug Support 1039 Jun-18-2012 05:30 AM
Correcting Chromatic Aberration in Adobe Camera Raw 5.6 - a few suggestions pathfinder Grad School 3 Jun-17-2011 01:34 PM
Photographic Terms: A - L ivar Tutorials 0 May-25-2011 12:08 PM
Professonional Photoshop, Chapter 8: Keeping the Black and White in Color mwgrice Finishing School 7 Feb-13-2007 11:58 AM
Chapter 11 - Retouching in LAB - Late and Incomplete pathfinder Finishing School 12 Mar-18-2006 08:12 AM


Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump