0
我試圖將我用jquery獲得的DOM元素傳入setClassToggle(element, class)
,但我不斷收到此錯誤。我在這裏錯過了什麼?在DOM元素中傳遞給setClassToggle
(ScrollMagic.Scene) - >錯誤調用方法'setClassToggle()': 提供了無效的元素。
<div class="grid-item" data-parallax="bouble">
<div class="container quote start" id="first">
<h2>"</h2>
<p>Vestibulum vitae congue nibh. Aliquam erat volutpat. Proin pretium mauris a quam molestie porttitor. Nulla vel molestie enim. Aenean suscipit cursus volutpat.</p>
</div>
</div>
var parallaxClass = $(this).data('parallax');
var element = $(this).find('.container');
if (parallaxClass === 'bouble') {
new ScrollMagic.Scene({
triggerElement: this,
triggerHook: 0.7
})
.addIndicators()
.setClassToggle(element, parallaxClass)
.addTo(controller);
}