我發現在doc接收一個nextIndex值onLeave事件:
$('#fullpage').fullpage({
anchors: ['home', 'work', 'contact'],
onLeave: function(index, nextIndex, direction){
if(nextIndex === 1) {
$('body').removeClass('foo');
} else {
$('body').addClass('foo');
}
}
});
這將增加2頁,3 Foo類,...然後將其取下第一頁上。建議
:不是:
<script type="text/javascript">
$(document).ready(function() {
$('#fullpage').fullpage({
anchors: ['home', 'work', 'contact'],
});
});
</script>
<script src="js/formvalidation.js"></script>
<script src="http://use.typekit.net/mye6dqa.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<script>
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message');
</script>
<script>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}
var succesvar = getURLParameter("succesful");
</script>
你可以這樣做:
<script src="js/formvalidation.js"></script>
<script src="http://use.typekit.net/mye6dqa.js"></script>
<script>
$(document).ready(function() {
$('#fullpage').fullpage({
anchors: ['home', 'work', 'contact'],
});
});
try{Typekit.load();}catch(e){}
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message');
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}
var succesvar = getURLParameter("succesful");
</script>
或與其他文件:
<script src="js/formvalidation.js"></script>
<script src="http://use.typekit.net/mye6dqa.js"></script>
<script src="js/main.js"></script>
將JS/main.js:
$(document).ready(function() {
$('#fullpage').fullpage({
anchors: ['home', 'work', 'contact'],
});
});
try{Typekit.load();}catch(e){}</script>
required.add('Full_Name','NOT_EMPTY','Full Name');
required.add('Email_Address','EMAIL','Email Address');
required.add('Your_Message','NOT_EMPTY','Your Message');
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
}
var succesvar = getURLParameter("succesful");
請在這裏添加有意義的代碼和問題描述。請不要鏈接到需要修復的網站 - 否則,一旦 問題得到解決,或者您鏈接到的網站無法訪問,此問題將對未來的訪問者失去任何價值。發佈 [最小,完整和可驗證示例(MCVE)](http://stackoverflow.com/help/mcve) 顯示您的問題將幫助您獲得更好的答案。欲瞭解更多信息,請參閱 [我網站上的某些內容不起作用。我可以只粘貼一個鏈接嗎?](http://meta.stackexchange.com/questions/125997/) 謝謝! – j08691 2016-01-29 20:34:25