![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
[SOLVED] Expandable Background
Hello,
I have a small problem with the site I am building. http://gcgcg.com/besttest/index.html http://gcgcg.com/besttest/code/best.css I will be putting it onto the main site when I am finished with it. I need the div background image to A) Resize (I solved that) B) Get longer when there is a lot of content, or a small screen that cannot fit the content in it. Also, if anyone knows how to make text scale in size, I would really appreciate that code as well. Thanks! |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 388
OS: Mac OS X 10.5.7 and XP SP2
|
Re: Expandable Background
That images/bordersback/backgroundgradient_03.jpg image is perfect to be tiled. For that whole table where all the ab ab ab's are, use:
style="background-image: url(images/bordersback/backgroundgradient_03.jpg); background-repeat: repeat-y;" in the tag. Take away that <img src="images/bordersback/backgroundgradient_03.jpg"> with the 100% width and height. Does this make sense to you? Also, your buttons are really messed up on Safari. Screenshot attached. |
|
|
|
|
|
#3 (permalink) |
|
Registered User
|
Re: Expandable Background
Thank you but that won't quite work.
The reason that I have the image widened instead of using a background is because I want it to look the same in all resolutions. Right now, it looks exactly the same in 800x600 as it does in 2048x1024 (except for the text, which I need to figure out how to auto-scale text) |
|
|
|
|
|
#6 (permalink) |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 678
OS: Ubuntu 9.04 [Jaunty Jackalope]
|
Re: Expandable Background
window.screen.availWidth
This property gets the users current screen width. Use this in an if statement. Say the width is 2048 you can set the pages font to be larger than the one already made for 800x600 HINT: You can use the operators below to make the font size increase automatically (if they have an odd screen resolution like 4096x???). if(screen.availWidth > 800) {code here;} > < >= <= |
|
|
|
|
|
#7 (permalink) |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 678
OS: Ubuntu 9.04 [Jaunty Jackalope]
|
Re: Expandable Background
Accidental posting of the same thing... I swear this NEVER happens ;-)
Last edited by ahmorrow; 07-05-2009 at 08:30 PM. Reason: Stupid thing posted twice lol |
|
|
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 388
OS: Mac OS X 10.5.7 and XP SP2
|
Re: Expandable Background
Let me know if this works for you:
Step 1: Paste the following script in the head of your document: Code:
<script type="text/javascript">
function resizeBackground(){
var content = document.getElementById('table');
var backimg = document.getElementById('backimg');
if (longdiv.style.pixelHeight) {
backimg.height = longdiv.style.pixelHeight;
} else {
backimg.height = longdiv.offsetHeight;
}
}
</script>
Code:
<body onresize="resizeBackground()" onload="MM_preloadImages('images/menubuttons/buttonson_01.png','images/menubuttons/buttonson_02.png','images/menubuttons/buttonson_03.png','images/menubuttons/buttonson_04.png','images/menubuttons/buttonson_05.jpg','images/menubuttons/buttonson_06.jpg')">
Code:
<div id="backgrad"><img src="images/bordersback/backgroundgradient_03.jpg" width="100%" id="backimg" /></div> |
|
|
|
|
|
#10 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 388
OS: Mac OS X 10.5.7 and XP SP2
|
Re: Expandable Background
Woops, just realized this won't work... if you ever come back to this.
The following script is correct. Code:
<script type="text/javascript">
function resizeBackground(){
var content = document.getElementById('table');
var backimg = document.getElementById('backimg');
if (content.style.pixelHeight) {
backimg.height = longdiv.style.pixelHeight;
} else {
backimg.height = longdiv.offsetHeight;
}
}
</script>
Last edited by FredT; 07-23-2009 at 01:46 PM. |
|
|
|
|
|
#12 (permalink) |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 678
OS: Ubuntu 9.04 [Jaunty Jackalope]
|
Re: Expandable Background
I compliment you and what do you do Freddy? This is unacceptable! I want your junior detective badge on my desk in 5 minutes! This is an outrage I tell ya, an outrage! lol
|
|
|
|
![]() |
| Thread Tools | |
|
|