将活动类添加到 Mootools Accordion 元素
随着 CSS3 的兴起,我想通过 css 过渡来控制 mootools 手风琴类使用的动画,我认为最好的方法是将活动类分配给手风琴的切换器和元素部分。
我已经能够对切换器元素执行此操作,但经过多次尝试,我无法弄清楚如何为该元素提供活动类。
到目前为止我得到的 mootools 代码是:
var myAccordion = new Fx.Accordion($$('.toggler'), $$('.services-element'), { display: 1, fps: 24, duration: 400, onActive: function(toggler) { toggler.addClass('active-accordion'); }, onBackground: function(toggler) { toggler.removeClass('active-accordion'); }, show: 0, height: false, width: false, opacity: 0.3, fixedHeight: 320, fixedWidth: null, alwaysHide: true, initialDisplayFx: false });
如果有人可以帮助解决这个问题,我将不胜感激。
With the rise of CSS3, I'd like to control the animation used by the mootools accordion class via css transitions, and I figure the best way to do that is to assign an active class to both the toggler and element parts of the accordion.
I've been able to do that for the toggler element, but after many attempts, I can't figure out how to give the element an active class.
The mootools code I've got so far is:
var myAccordion = new Fx.Accordion($('.toggler'), $('.services-element'), { display: 1, fps: 24, duration: 400, onActive: function(toggler) { toggler.addClass('active-accordion'); }, onBackground: function(toggler) { toggler.removeClass('active-accordion'); }, show: 0, height: false, width: false, opacity: 0.3, fixedHeight: 320, fixedWidth: null, alwaysHide: true, initialDisplayFx: false });
If anyone can help with this, I'd be most appreciative.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢 Johan 提供的信息,我对 onActive 和 onBackground 规则进行了如下修改:
这给了我我所需要的。
Thanks to the info provided by Johan, I've amended the onActive and onBackground rules as follows:
This gives me what I need.