-
AuthorPosts
-
December 26, 2011 at 6:21 pm #172168
Hi everyone, I’d like to have several backgrounds in my website, and each time I reload the site, another background appears. Does anyone knows how to do this? Thank you very much!
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
December 26, 2011 at 8:37 pm #431237This is likely a javascript function.
I believe there are several background rotator extensions available within the Joomla Extension Directory[/url]
1 user says Thank You to TomC for this useful post
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
December 27, 2011 at 2:05 am #431290In JA Teline IV
body#bd {
background: none repeat scroll 0 0 #FFFFFF;
color: #333333;
font-size: 12px;
line-height: 1.5;
}This css is handled for body background color. So if you want for background changing you can apply js for this. BUT in case browsers is not js enabled ( specially like google bots ) it won’t be effect.
So we can apply via php codepluginssystemjat3jat3base-themesdefaultpagedefault.php
<body id="bd" class="<?php if (!T3Common::mobile_device_detect()):?>bd<?php endif;?> <?php echo $this->getBodyClass();?>">
As you can see in this line code you can insert your code into template. And in this case we can:
– Directly insert style into body tag
For sample:
<?php
$colors = array ('red','black','blue','green');
$color = array_rand ($colors);
?>
<body id="bd" class="<?php if (!T3Common::mobile_device_detect()):?>bd<?php endif;?> <?php echo $this->getBodyClass();?>" style="background:<?php $color;?>;">
– Insert extra css code
Same as above but instead insert style we insert extra classname.By do this way we can easier for handle which / how color will apply.
And keep less extension installed on site ( less is better )Thank you
1 user says Thank You to jooservices for this useful post
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
December 27, 2011 at 2:06 am #431291and this will change/rotate the background on “refresh” in all browsers, Joo ??
December 29, 2011 at 2:06 am #431699Thank you very much guys! I managed to do it with an extension, i tried the jooservices’s method but didn’t know exactly what to change, and I tried an extension and worked well so, it’s my solution so far
Happy new year! Cheers:)
TomC ModeratorTomC
- Join date:
- October 2014
- Posts:
- 14077
- Downloads:
- 58
- Uploads:
- 137
- Thanks:
- 948
- Thanked:
- 3155 times in 2495 posts
December 29, 2011 at 4:41 am #431711<em>@creativos2012 291821 wrote:</em><blockquote>Thank you very much guys! I managed to do it with an extension, i tried the jooservices’s method but didn’t know exactly what to change, and I tried an extension and worked well so, it’s my solution so far
Happy new year! Cheers:)</blockquote>
GREAT JOB !!! . . . . Glad my advice to check out the extensions within the JED was helpful to you.All the best with your continued site development.
-
AuthorPosts
This topic contains 6 replies, has 3 voices, and was last updated by TomC 12 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum