0

I have successfully added background graphics using the module BackgroundField module with the help of this previous question. We've had a feature creep in that we need to have a rotating image from a preset pool of images. Does anyone know of an module to facilitate this request?

2 Answers 2

2

It is not a Drupal Module but a very simply jQuery plugin to use.

http://jquery.malsup.com/cycle/

A snippet of me using it from my javascript:

function handle_header_carousel() {
    if ( jQuery('#header_carousel').get(0) == undefined ) {
        return;
    }
    jQuery('#header_carousel').cycle({ 
        fx:     'fade', 
        speed:   300, 
        timeout: 3000, 
        next:   '#s3', 
        pause:   1 
    });
}

From my template page that houses the images:

<div id="header_carousel">
            <img src="/<?php echo drupal_get_path("theme", "tcth"); ?>/img/carousel_1.jpg" />
            <img src="/<?php echo drupal_get_path("theme", "tcth"); ?>/img/carousel_2.jpg" />
            <img src="/<?php echo drupal_get_path("theme", "tcth"); ?>/img/carousel_3.jpg" />
            <img src="/<?php echo drupal_get_path("theme", "tcth"); ?>/img/carousel_4.jpg" />
        </div>
1
  • I up-voted this as a great JS workaround but it turns out that this module had that built in already. Though, I may come back to this later. Thanks again.
    – Rick
    Commented Oct 18, 2012 at 13:38
0

Turns out the module does it automatically. I also asked for this as an interface enhancement on drupal.org. The developer responded saying that that feature already exists. All you have to do is set the field to unlimited. How freaking awesome is that?!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.