为什么我的滚动显示消失不可以
来源:3-3 JS类规划
从何说起_
2017-06-10
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> body{ margin: 0;padding: 0; } .component{ width: 50%;height: 50px;margin-bottom:20px; background-color:#eee; display: none; } </style> </head> <body> <div id="h5"> <div class="page section" id='page-1'> <div class="component log">logo</div> <div class="component slogan">slogan</div> </div> <div class="page section" id='page-2'> <div class="component desc">desc</div> </div> <div class="page section" id='page-3'> <div class="component bar">bar</div> </div> <div class="page section" id='page-4'> <div class="component bar">bat</div> </div> </div> </body> <script type="text/javascript" src='../js/lib/jquery.js'></script> <script type="text/javascript" src='../js/lib/jquery-ui.min.js'></script> <script type="text/javascript" src='../js/lib/jquery.fullPage.js'></script> <script type="text/javascript"> $(function(){ $('#h5').fullpage({ 'sectionsColor' : ['#254875','#00ff00','#254587','#695684'], onLeave:function(index,nextIndex,direction){ $('#h5').find('.page').eq(index-1).trigger('onLeave'); } afterLoad:function(anchorLink,index){ $('#h5').find('.page').eq(index-1).trigger('onLoad'); } }); $('.page').on('onLeave',function(){ $(this).find('.component').trigger('onLeave'); }); $('.page').on('onLoad',function(){ $(this).find('.component').trigger('onLoad'); }); $('.component').on('onLoad',function(){ $(this).fadeIn(); return false; }); $('.component').on('onLeave',function(){ $(this).fadeOut(); return false; }); }); </script> </html>
写回答
1回答
-
qq_虫子_7
2017-06-10
代码是没问题的
012017-06-10
相似问题