The MU forums have moved to WordPress.org

Rotating Background like MTV.com (8 posts)

  1. bwinn
    Member
    Posted 16 years ago #

    Does anyone know how to do a background like mtv.com? I want basically, a rotating background image that will fade into the color of the background page.

    I already have a plugin installed that allows me to rotate my backgrounds, but I don't know how to have rotating css code that will match the background image.

    I am sure there is an array or something I need to do but I am stuck. Does anyone have an easy solution for this?

  2. bwinn
    Member
    Posted 16 years ago #

    Sorry for the double post, I think I hit send post twice. My bad :(

  3. DailyTestimony
    Member
    Posted 16 years ago #

    annimated gif maybe?

  4. andrea_r
    Moderator
    Posted 16 years ago #

    What you're actually looking for is a randomizing image. :) If you study the plugins and such for random headers, it's the same for a background graphic.

  5. bwinn
    Member
    Posted 16 years ago #

    I already have the plugin andrea. If you look at mtvs site, half of their background is an image and have is a hex# color probably used in the css. How can I have half image have color? That is my question. Thanks

  6. andrea_r
    Moderator
    Posted 16 years ago #

    Did you read the source? :D I did.

    Do you want to kmnow how they did it in particular, or just how you can do the same with what you've got (ie; the easy way)?

    you've already got the plugin - that's most of the work. just comment out the body background in the stheme stylesheet, and in the header, put the css code in there for the background image (or in a seperate file as they've done if there's a lot) but using the php to pull a random image.

    that's all they've done. their source fiels show everything except how they randomized. (which you've got)

    also, the reason they include a hex color as well as an image is a) to make the code more vaild, and b) have something to display other than white in case the image doesn't load or loads slowly. So the color is technically :behind" the background image.

  7. bwinn
    Member
    Posted 16 years ago #

    Awesome thanks Andrea, you freakin rock!

  8. andrea_r
    Moderator
    Posted 16 years ago #

    Sweeeet. :)

About this Topic