scrollmagic Section Wipes - 效果结束

时间:2017-02-01 16:48:32

标签: html css scrollmagic

我试图在固定部分之后添加一些部分,但是在效果结束后,松弛的面板不会消失,其他部分总是在擦拭部分下面 这是我的代码

<link rel="stylesheet" href="http://scrollmagic.io/css/examples.css" type="text/css">
<link rel="stylesheet" href="http://scrollmagic.io/css/style.css" type="text/css">
<script src="http://scrollmagic.io/js/lib/jquery.min.js"></script>
<script src="http://scrollmagic.io/js/lib/greensock/TweenMax.min.js"></script>
<script src="http://scrollmagic.io/scrollmagic/uncompressed/ScrollMagic.js"></script>
<script src="http://scrollmagic.io/scrollmagic/uncompressed/plugins/animation.gsap.js"></script>
<script src="http://scrollmagic.io/scrollmagic/uncompressed/plugins/debug.addIndicators.js"></script>

<body>
	<div id="content-wrapper">
		<div id="example-wrapper">
			<div class="scrollContent">
				<section id="titlechart">
					<div id="description">
						<h1 class="badge gsap">Section Wipes (manual)</h1>
						
					</div>
				</section>
				<section class="demo" id="section-wipes">
					<style type="text/css">
						#pinContainer {
							width: 100%;
							height: 100%;
							overflow: hidden;
						}
						.panel {
							height: 100%;
							width: 100%;
							position: absolute;
						}
					</style>
					<div id="pinContainer">
						<section class="panel blue">
							<b>ONE</b>
						</section>
						<section class="panel turqoise">
							<b>TWO</b>
						</section>
						<section class="panel green">
							<b>THREE</b>
						</section>
						<section class="panel bordeaux">
							<b>FOUR</b>
						</section>
					</div>
					<script>
						$(function () { // wait for document ready
							// init
							var controller = new ScrollMagic.Controller();

							// define movement of panels
							var wipeAnimation = new TimelineMax()
								.fromTo("section.panel.turqoise", 1, {x: "-100%"}, {x: "0%", ease: Linear.easeNone})  // in from left
								.fromTo("section.panel.green",    1, {x:  "100%"}, {x: "0%", ease: Linear.easeNone})  // in from right
								.fromTo("section.panel.bordeaux", 1, {y: "-100%"}, {y: "0%", ease: Linear.easeNone}); // in from top

							// create scene to pin and link animation
							new ScrollMagic.Scene({
									triggerElement: "#pinContainer",
									triggerHook: "onLeave",
									duration: "300%"
								})
								.setPin("#pinContainer")
								.setTween(wipeAnimation)
								.addIndicators() // add indicators (requires plugin)
								.addTo(controller);
						});
					</script>
				</section>

      </div>
      <section id="aboutus">
        <div id="description1">

        </div>
      </section>

      <section id="contactus">
        <div id="description2">

        </div>
      </section>
    </div>
  </div>
</body>

我试图改变triggerHook和持续时间,但它扭曲了页面 我认为问题是持续时间为300%,页面高度也是100%

我只想尝试在本示例的末尾添加一些部分 http://scrollmagic.io/examples/advanced/section_wipes_manual.html 关键是要为我网站中的某些部分添加wips效果 tnx

0 个答案:

没有答案