Cacofonix
Cacofonix

Reputation: 465

How to fadeIn the globalCaption when item becomes active?

Am using Contentflow to display an image gallery. Among the configuration options there is also this code:

        /*
         * called when an item becomes active.
         */
        onMakeActive: function (item) {},

On the HTML markup, there is this div:

<div class='globalCaption'></div>

I want the .globalCaption to fadeIn when item becomes active so I added this:

         /*
         * called when an item becomes active.
         */
        onMakeActive: function (item) {
        $(".globalCaption p").fadeIn('fast');
        },

...and it doesn't work

Upvotes: 1

Views: 109

Answers (3)

Peter
Peter

Reputation: 29877

There is a known bug with IE and this event http://code.google.com/p/contentflow/issues/detail?id=17

Upvotes: 0

SteamDev
SteamDev

Reputation: 477

First, change your selector from $(".globalCaption p") to $(".globalCaption")

Secondly, make sure .globalCaption is styled display:none; by default. It can not fade in if it is already visible.

Upvotes: 1

bfavaretto
bfavaretto

Reputation: 71939

You say you have the following div:

<div class='globalCaption'></div>

But your jQuery code is telling the browser to fade in a p element inside that div, and the p doesn't seem to exist. Try removing the p from the selector, like so:

$(".globalCaption").fadeIn('fast');

Upvotes: 0

Related Questions