Difference between revisions of "Team:HSNU-TAIPEI"

Line 41: Line 41:
 
}
 
}
  
 +
.home-about,
 
.three-link .home-bg {
 
.three-link .home-bg {
 
     width: 100%;
 
     width: 100%;
Line 65: Line 66:
  
 
.home-about {
 
.home-about {
    width: 66.6666%;
 
 
     min-height: 1px;
 
     min-height: 1px;
 
     background: tomato;
 
     background: tomato;
Line 306: Line 306:
 
</footer>
 
</footer>
 
</div>
 
</div>
 
<script>
 
var main = function() {
 
  var slideToNext = function() {
 
    var currentSlide = $('.active-slide'),
 
        currentDot = $('.active-dot');
 
    var nextSlide = currentSlide.next('.slide'),
 
        nextDot = currentDot.next();
 
    if(nextSlide.length === 0) {
 
      nextSlide = $('.slide').first();
 
      nextDot = $('.dot').first();
 
    }
 
    currentSlide.fadeOut(600).removeClass('active-slide');
 
    currentDot.removeClass('active-dot');
 
    nextSlide.fadeIn(600).addClass('active-slide');
 
    nextDot.addClass('active-dot');
 
  };
 
  var slideToPrev = function() {
 
    var currentSlide = $('.active-slide'),
 
        currentDot = $('.active-dot');
 
    var prevSlide = currentSlide.prev('.slide'),
 
        prevDot = currentDot.prev();
 
    if(prevSlide.length === 0) {
 
      prevSlide = $('.slide').last();
 
      prevDot = $('.dot').last();
 
    }
 
    currentSlide.fadeOut(600).removeClass('active-slide');
 
    currentDot.removeClass('active-dot');
 
    prevSlide.fadeIn(600).addClass('active-slide');
 
    prevDot.addClass('active-dot');
 
  };
 
  $('.arrow-next').click(slideToNext);
 
  $('.arrow-prev').click(slideToPrev);
 
  if($('.slider-nav').css('display') !== 'none') {
 
    setInterval(slideToNext, 5000);
 
  }
 
};
 
$(document).ready(main);
 
</script>
 
  
 
</html>
 
</html>
 
{{HSNU-TAIPEI/nav_js}}
 
{{HSNU-TAIPEI/nav_js}}

Revision as of 11:50, 8 September 2015