我有一个JQuery和JS脚本冲突,当它们分别运行时它们可以工作,但是当它们一起运行时,第二个就不起作用。
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="fullpagejs/jquery.fullpage.min.js"></script>
<script>
// Fullpage Scroll Init
$(document).ready(function(){
$('#fullpage').fullpage({ });
// Scroll Indicator from W3Schools
window.onscroll = function() {myFunction()};
function myFunction() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("myBar").style.width = scrolled + "%";
}
});
</script>
</body>