当项目变为活动状态时,如何淡入全局标题?
我正在使用 Contentflow 来显示图片库。在配置选项中还有这样的代码:
/*
* called when an item becomes active.
*/
onMakeActive: function (item) {},
在 HTML 标记上,有这样的 div:
<div class='globalCaption'></div>
我希望 .globalCaption 在项目变为活动状态时淡入淡出,所以我添加了以下代码:
/*
* called when an item becomes active.
*/
onMakeActive: function (item) {
$(".globalCaption p").fadeIn('fast');
},
...但它不起作用
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,将选择器从
$(".globalCaption p")
更改为$(".globalCaption")
其次,确保
.globalCaption
是默认样式为display:none;
。如果它已经可见,则它无法淡入。First, change your selector from
$(".globalCaption p")
to$(".globalCaption")
Secondly, make sure
.globalCaption
is styleddisplay:none;
by default. It can not fade in if it is already visible.您说您有以下 div:
但是您的 jQuery 代码告诉浏览器淡入该 div 内的
p
元素,而p
似乎不存在。尝试从选择器中删除p
,如下所示:You say you have the following div:
But your jQuery code is telling the browser to fade in a
p
element inside that div, and thep
doesn't seem to exist. Try removing thep
from the selector, like so:IE 和此事件存在一个已知错误
http://code.google.com/p/contentflow/issues/detail ?id=17
There is a known bug with IE and this event
http://code.google.com/p/contentflow/issues/detail?id=17