xyncro Posted May 13, 2009 Share Posted May 13, 2009 .. 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... ..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... ..however my other question is unsolved.. ..would it be possible to add a background image that automatically changes every month? thx... :yeahhh: Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 16, 2009 Share Posted May 16, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.