It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

resize of a random background

resize of a random background

Postby jbetts1967 on Fri Aug 15, 2008 8:07 pm

is there a way to display a random selected background with out having several different size backgrounds of the same background.... below is the code i have for displaying a random background....

<script language="JavaScript">document.open(); document.write("<body background = '" + bgimage + "' text = '" + text_color + "'>");</script>

there are 20 different backgrounds that are displayed at random each time the page is loaded or reloaded. is there a way to have the background resize to the users screensize without having 5 or 10 copies of the same background with different sizes....
jbetts1967
 
Posts: 5
Joined: Sat Jul 26, 2008 10:37 pm

Postby instinct46 on Mon Sep 22, 2008 11:23 am

This is an alright tutorial for showing.

When doing this you tell javascript to fetch the clients screen size and store the information as a varible which can then be past on to PHP or used on the same page.

http://www.javascripter.net/faq/screensi.htm
User avatar
instinct46
50+ Club
 
Posts: 90
Joined: Tue Mar 27, 2007 1:07 pm
Location: St Helens, England


Who is online

Users browsing this forum: No registered users and 0 guests