Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
scroll
css
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@700;900&display=swap'); @import url('https://lib.sinaapp.com/js/bootstrap/4.2.1/css/bootstrap.min.css'); :root { font-size: 20px; --dark-blue: #102770; --white-gr: #c4c3ca; --yellow: #ffeba7; } body{ color: var(--white-gr); background-color: var(--dark-blue); overflow-x: hidden; } h1{ font-family: 'Lato', sans-serif; font-weight: 900; color: var(--yellow); font-size: 12vw; } .section { position: relative; width: 100%; display: block; z-index: 2; } .over-hide { overflow: hidden; } .full-height { height: 100vh; } .z-bigger { z-index: 10 !important; } .section-center { position: absolute; top: 50%; left: 0; width: 100%; z-index: 10; transform: translateY(-50%); } main { position: relative; width: 100%; display: block; z-index: 2; -webkit-transition: all 200ms linear; transition: all 200ms linear; } .viewport { overflow: hidden; position: fixed; height: 100%; width: 100%; top: 0; left: 0; right: 0; bottom: 0; } .scroll-container { position: absolute; width: 100%; top: 0; left: 0; z-index: 10; overflow: hidden; transform-style: preserve-3d; } .img-loader { position: absolute; bottom: -25%; left: -25%; width: 150%; height: 150%; background-color: var(--dark-blue); } .img-wrap img{ width: 100%; height: auto; display: block; border-radius: 6px; } .logo { position: fixed; bottom: 30px; right: 30px; display: block; z-index: 200000; transition: all 250ms linear; } .logo img { height: 40px; width: auto; display: block; mix-blend-mode: difference; }
JavaScript
!function(e,n){"function"==typeof define&&define.amd?define(["ScrollMagic","TweenMax","TimelineMax"],n):"object"==typeof exports?(require("gsap"),n(require("scrollmagic"),TweenMax,TimelineMax)):n(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.TweenMax||e.TweenLite,e.TimelineMax||e.TimelineLite)}(this,function(e,n,o){"use strict";var t=window.console||{},r=Function.prototype.bind.call(t.error||t.log||function(){},t);e||r("(animation.gsap) -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs."),n||r("(animation.gsap) -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs."),e.Scene.addOption("tweenChanges",!1,function(e){return!!e}),e.Scene.extend(function(){var e,t=this,r=function(){t._log&&(Array.prototype.splice.call(arguments,1,0,"(animation.gsap)","->"),t._log.apply(this,arguments))};t.on("progress.plugin_gsap",function(){i()}),t.on("destroy.plugin_gsap",function(e){t.removeTween(e.reset)});var i=function(){if(e){var n=t.progress(),o=t.state();e.repeat&&-1===e.repeat()?"DURING"===o&&e.paused()?e.play():"DURING"===o||e.paused()||e.pause():n!=e.progress()&&(0===t.duration()?n>0?e.play():e.reverse():t.tweenChanges()&&e.tweenTo?e.tweenTo(n*e.duration()):e.progress(n).pause())}};t.setTween=function(a,s,l){var c;arguments.length>1&&(arguments.length<3&&(l=s,s=1),a=n.to(a,s,l));try{(c=o?new o({smoothChildTiming:!0}).add(a):a).pause()}catch(e){return r(1,"ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject"),t}if(e&&t.removeTween(),e=c,a.repeat&&-1===a.repeat()&&(e.repeat(-1),e.yoyo(a.yoyo())),t.tweenChanges()&&!e.tweenTo&&r(2,"WARNING: tweenChanges will only work if the TimelineMax object is available for ScrollMagic."),e&&t.controller()&&t.triggerElement()&&t.loglevel()>=2){var u=n.getTweensOf(t.triggerElement()),p=t.controller().info("vertical");u.forEach(function(e,n){var o=e.vars.css||e.vars;if(p?void 0!==o.top||void 0!==o.bottom:void 0!==o.left||void 0!==o.right)return r(2,"WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!"),!1})}if(parseFloat(TweenLite.version)>=1.14)for(var g,d,f=e.getChildren?e.getChildren(!0,!0,!1):[e],w=function(){r(2,"WARNING: tween was overwritten by another. To learn how to avoid this issue see here: https://github.com/janpaepke/ScrollMagic/wiki/WARNING:-tween-was-overwritten-by-another")},h=0;h
0; if (resized) { var height = scroller.target.clientHeight; body.style.height = height + "px"; scroller.resizeRequest = 0; } var scrollY = window.pageYOffset || html.scrollTop || body.scrollTop || 0; scroller.endY = scrollY; scroller.y += (scrollY - scroller.y) * scroller.ease; if (Math.abs(scrollY - scroller.y) < 0.05 || resized) { scroller.y = scrollY; scroller.scrollRequest = 0; } TweenLite.set(scroller.target, { y: -scroller.y }); requestId = scroller.scrollRequest > 0 ? requestAnimationFrame(updateScroller) : null; } function onScroll() { scroller.scrollRequest++; if (!requestId) { requestId = requestAnimationFrame(updateScroller); } } function onResize() { scroller.resizeRequest++; if (!requestId) { requestId = requestAnimationFrame(updateScroller); } } const controller = new ScrollMagic.Controller(); var forEach = function(array, callback, scope) { for (var i = 0; i < array.length; i++) { callback.call(scope, i, array[i]); } }; var myNodeList = document.querySelectorAll(".img-loader"); forEach(myNodeList, function(index, value) { const tween = TweenMax.to(value, 2, { borderTopLeftRadius:"100%", borderTopRightRadius:"100%", delay:0.3, height: 0, ease: Power2.easeOut }); const itemScene = new ScrollMagic.Scene({ triggerElement: value, triggerHook: 0.6, reverse: false }) .setTween(tween) .addTo(controller); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>平滑滚动显示-GSAP-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号