Jump to content

fixed background


xyncro

Recommended Posts

.. :unsure:

i have 2 questions concerning the background image..

..how do i fix the background images so it won't move when i scroll?

..i found a solution... :blush:

..first make a backup and then open up skin/styleSheets/layout.css:

find:

body {

margin: 5px 0;

replace with:

body {

background-image: url(../styleImages/backgrounds/name_of_image.jpg);

background-attachment:fixed;

margin: 5px 0;

..save and close, and there you have it... :unsure:

..however my other question is unsolved..

..would it be possible to add a background image that automatically changes every month?

thx... :yeahhh:

Link to comment
Share on other sites

Sure. Restore your layout.css back to the way it was. Then I see two approaches:

1. Make 12 background.css files and code an additional <link> tag, or

2. code the style="" parameter in the <body> tag of your index.tpl file.

1. In a file called background01.css file, put:

body {

background-image: url(../styleImages/backgrounds/january.jpg);

background-attachment:fixed; }

Then in \skins\{your_skin}\styleTemplates\global\index.tpl, add

<link href="skins/{VAL_SKIN}/styleSheets/background{VAL_MONTH}.css" rel="stylesheet" type="text/css" />

Make the appropriate coding changes to the index.inc.php file that parses index.tpl to deal with {VAL_MONTH}.

2. Very similar to above but in layout.css, add

body.01 {

background-image: url(../styleImages/backgrounds/january.jpg);

background-attachment:fixed; }

Then, inside the <body> tag, add id="{VAL_MONTH}".

Make the appropriate coding changes to the index.inc.php file that parses index.tpl to deal with {VAL_MONTH}.

Now, you didn't say if you wanted the change to use 12 predetermined, pre-assigned images, or if you wanted just a random image to swap in when the month rolls over.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...