為什么使用fullpage時候用move.js的onLeave無法觸發(fā)第二次效果也無法回調(diào)到上以頁面,通過Chrome提示移動必須使用元素或選擇器進(jìn)行初始化,請問問題出現(xiàn)在哪里怎么解決,代碼如下:<!doctype html><html><head><meta charset="utf-8"><title>fullpage熟悉</title><link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css"><style type="text/css">*body{ padding:0; margin:0;}.section{ text-align:center;}.section1 h1{ font-size:70px;}.section1 h3{ font-size:30px;}.section1 p{ font-size:18px; margin-top:800px;}.seciton2 h3{ font-size:30px; margin-left:-1500px;}.seciton2 p{ font-size:18px; margin-left:1500px;}</style></head><body><div id="fullpage">?? ?<div class="section section1">?? ??? ?<h1>fullpage練習(xí)</h1>??????? <h3>現(xiàn)在開始</h3>??????? <p>這是第一個頁面</p>??? </div>??? <div class="section section2">?? ??? ?<h3>左邊進(jìn)攻</h3>??????? <p>右邊進(jìn)攻</p>??? </div></div><script type="text/javascript" src="js/jquery-2.1.4.js"></script><script type="text/javascript" src="js/jquery.fullPage.js"></script><script type="text/javascript" src="js/move.js"></script><script type="text/javascript">?? ?$(document).ready(function() {??????? $('#fullpage').fullpage({?? ??? ??? ?sectionsColor:['red','yellow'],?? ??? ??? ?anchors:['page1','page2'],?? ??? ??? ?navigation:true,?? ??? ??? ?navigationPosition:'right',?? ??? ??? ?navigationTooltips:['page1','page2'],?? ??? ??? ?afterLoad:function(link,index){?? ??? ??? ??? ?switch(index){?? ??? ??? ??? ??? ?case 1:move('.section1 h1').scale(1.5).end();?? ??? ??? ??? ??? ??? ??? move('.section1 h3').scale(0.7).end();?? ??? ??? ??? ??? ??? ??? move('.section1 p').set('margin-top','5%').end();?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?case 2:move('.section2 h3').set('margin-left','20%').end();?? ??? ??? ??? ??? ??? ??? move('.section2 p').set('margin-left','-20%').end();?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?default:?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?}?? ??? ??? ??? ?},?? ??? ??? ?onLeave:function(link,index){?? ??? ??? ??? ?switch(index){?? ??? ??? ??? ??? ?case 1:move('section1 h1').scale(1).end();?? ??? ??? ??? ??? ??? ??? move('section1 h3').scale(1).end();?? ??? ??? ??? ??? ??? ??? move('section1 p').set('margin-top','800px').end();?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?case 2:move('.section2 h3').set('margint-left','-1500px').end();?? ??? ??? ??? ??? ??? ??? move('.section2 p').set('margint-left','1500px').end();?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?default:?? ??? ??? ??? ??? ?break;?? ??? ??? ??? ??? ?}?? ??? ??? ??? ?},?? ??? ??? ?afterRender:function(){?? ??? ??? ??? ?},?? ??? ?});??? });</script></body></html>
- 1 回答
- 0 關(guān)注
- 1307 瀏覽
添加回答
舉報
0/150
提交
取消