Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • creativos2012 Friend
    #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 Moderator
    #431237

    This is likely a javascript function.

    I believe there are several background rotator extensions available within the Joomla Extension Directory[/url]

    jooservices Friend
    #431290

    In 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 code

    pluginssystemjat3jat3base-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

    TomC Moderator
    #431291

    and this will change/rotate the background on “refresh” in all browsers, Joo ??

    creativos2012 Friend
    #431699

    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:)

    TomC Moderator
    #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.

Viewing 6 posts - 1 through 6 (of 6 total)

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