TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-02-2009, 04:35 AM   #1 (permalink)
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default Showing background based on resolution

Hey,

I have a really big background image but I only want to show the full image to those who have the resolution for it, the others will only see partial of the image. I've seen some sites do this effect, how can I accomplish this?

One perfect example is www.worldofwarcraft.com If you notice the left and right background images, they are really big but only show what you resolution can handle.

Thanks :)
9three is offline  
Reply With Quote
Old 05-03-2009, 04:48 AM   #2 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

that would be javascript, not php

Code:
var w = screen.width;
var h = screen.height;
document.getElementByID('hiddendiv').style.width=w;
document.getElementByID('hiddendiv').style.height=h;
I would test this in different browsers first, I don't recall if this works in earlier versions of IE.

It might just be easier to use shadowbox, as it is nice and fluid - and best of all - already written :P
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
jcorradino is offline  
Reply With Quote
Old 05-03-2009, 04:49 AM   #3 (permalink)
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default

No I got it actually. Using css only :)
9three is offline  
Reply With Quote
Old 05-03-2009, 05:00 AM   #4 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

cool, css would be a pretty quick solution to it as well :)

how does it work with IE6? IE6 always seems to have an issue with positioning (well... anything you throw at it, it sometime seems)
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
jcorradino is offline  
Reply With Quote
Old 05-03-2009, 03:52 PM   #5 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

I'm guessing its just an image that is tiled, then you can use repeat-x to repeat the bg
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 05-03-2009, 04:54 PM   #6 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

oh sorry! I thought you were talking about the lightbox effect the page has set up... I didnt even see the background...

That is simple, all that is is multiple divs making up the background. The left background is set to position to the right and the right background is set to position to the left. This way, when a user comes to the site, they will always see the picture (at least some of it), and it always keeps down on the load time.
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
jcorradino is offline  
Reply With Quote
Old 05-03-2009, 05:06 PM   #7 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

with css its just setting it as a background image for the body tag and center aligning it. Then if anyone has a really large resolution you must make the choice of tiling the background or just having a solid color.
CoryMathews is offline  
Reply With Quote
Old 05-03-2009, 06:16 PM   #8 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

Quote:
Originally Posted by CoryMathews View Post
with css its just setting it as a background image for the body tag and center aligning it. Then if anyone has a really large resolution you must make the choice of tiling the background or just having a solid color.
Actually, that is not the case in this instance. The images are applied as a background on the body (as a 2609x599 px image), and in the "ne-center" div inside of the navigation (as a 980x548 px image). Not exactly the most elegant way to achieve this, but it works.
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
jcorradino is offline  
Reply With Quote
Old 05-04-2009, 03:49 AM   #9 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

Quote:
Originally Posted by jcorradino View Post
Actually, that is not the case in this instance. The images are applied as a background on the body (as a 2609x599 px image), and in the "ne-center" div inside of the navigation (as a 980x548 px image). Not exactly the most elegant way to achieve this, but it works.
What? I did not follow that.
CoryMathews is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Font color for key based on modif date ? Peuplarchie General 1 04-14-2009 01:37 PM
Flat file array, replace 3rd key value based on itself. Peuplarchie Absolute Beginners 1 07-22-2008 12:38 AM
Dynamicly place text on a background image ReSpawN Advanced PHP Programming 2 04-26-2008 09:37 PM


All times are GMT. The time now is 04:25 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design