私はScrollmagicで遊んでいて、いくつかのことをうまく機能させることができました。私が今やろうとしているのは、ビューポートの下部にブログ用の粘着性のあるソーシャル共有バーを作成することです。コードに表示させるのに問題はありませんでした
// Sticky Share Bar
var stickyShareAnimation = TweenMax.fromTo(shareBar, 0.5,
{ bottom:-50},
{ bottom:0 }
);
var share = new ScrollMagic.Scene({
triggerElement: '.entry',
offset:60,
})
.setTween(stickyShareAnimation)
.setPin('.share-bar')
.addIndicators()
.addTo(controller)
これはHTMLです
<section class="share-bar">
<div id="share-container" class="container">
<div class="row">
<div class="col-md-12">This is the content</div>
</div>
</div>
</section>
<section class="blog-content">
<div class="container">
<div class="row">
<article class="single-post">
<div class="entry">
<?php the_content();?>
</div>
</article>
</div>
</div>
</section>
<section class="Test">
Where I want sharebar to tweenout.
</section>
「セクション テスト」を対象とする別の Tweenmax アニメーションを使用して共有バーをフェードアウトできることはわかっていますが、最初の JavaScript でこれを行うには、おそらくもっと良い方法があると考えました。別の方法はありますか、またはコンテンツ (div.entry) の終了後に共有バーを非表示にするために別の Tween を作成する必要がありますか。