Difference between revisions of "Template:CCU Taiwan"

Line 1: Line 1:
 
<html>
 
<html>
 +
<script>
 +
$(window).on('scroll',function() {
 +
  if($(window).scrollTop())
 +
{
 +
    $('.container').css('background', '#808080');
 +
$('nav ul li ul').css('background', '#808080');
 +
$('nav').css('opacity','1');
 +
    }
 +
    else
 +
{
 +
$('.container').css('background', '#000000');
 +
$('nav ul li ul').css('background', '#000000');
 +
$('nav').css('opacity','1');
 +
    }
 +
  });
 +
// When the user scrolls the page, execute myFunction
 +
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.height = scrolled + "%";
 +
}
 +
 +
$(document).ready(function(){
 +
  // Add smooth scrolling to all links
 +
  $("a").on('click', function(event) {
 +
 +
    // Make sure this.hash has a value before overriding default behavior
 +
    if (this.hash !== "") {
 +
      // Prevent default anchor click behavior
 +
      event.preventDefault();
 +
 +
      // Store hash
 +
      var hash = this.hash;
 +
 +
      // Using jQuery's animate() method to add smooth page scroll
 +
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
 +
      $('html, body').animate({
 +
        scrollTop: $(hash).offset().top
 +
      }, 800, function(){
 +
 
 +
        // Add hash (#) to URL when done scrolling (default click behavior)
 +
        window.location.hash = hash;
 +
      });
 +
    } // End if
 +
  });
 +
});
 +
 +
$(window).on('scroll',function() {
 +
  if($(window).scrollTop())
 +
{
 +
    $('.container').css('background', '#808080');
 +
$('nav ul li ul').css('background', '#808080');
 +
$('nav').css('opacity','1');
 +
    }
 +
    else
 +
{
 +
$('.container').css('background', '#000000');
 +
$('nav ul li ul').css('background', '#000000');
 +
$('nav').css('opacity','1');
 +
    }
 +
  });
 +
$(document).ready(function(){
 +
$('#fullPage').fullpage({
 +
scrollingSpeed: 30,
 +
});
 +
});
 +
</script>
 +
 
<style>
 
<style>
 
/*DEFAULT WIKI SETTINGS*/
 
/*DEFAULT WIKI SETTINGS*/

Revision as of 14:08, 12 July 2018