묻고답하기

각 섹션의 높에값에 오면 ani_section함수가 실행되게 하려고 하는데

문제 1 ani_section함수가 계속 반복되서 나옵니다.

문제 2 섹션 함수가 순차적으로 나오게 하고 싶은데 stop().을 animate()앞에 주면 동시에 실행 되요,,

고수님들 부탁 드립니다, 급한거라...ㅠ.ㅠ'

 

 

$(function(){

  var section1 = 0;
  var section2 = 0;
  var section3 = 0;
  var section4 = 0;
  var section6 = 0;
  var section7 = 0;
  var section8 = 0;
  ani_section1();


 $(window).scroll(function(){

    if($(this).scrollTop() == 0){
      ani_section1();
      section1 = 1;
      //섹션1 포지션 플래그 함수
      fixRightBt_Section1();
    }

    if($(this).scrollTop() >800){
      if(section2==0){
        ani_section2();
        section2 = 1;
      }
      else {
        $('#section_2').stop();
        //섹션2 포지션 플래그 함수
        fixRightBt_Section2();

      }
    }

    if( $(this).scrollTop() > 1800 ){
      if(section3 == 0){
        ani_section3();
        section3 = 1;
      }
      else {
        $("#section_3").stop();

        //섹션3 포지션 플래그 함수
        fixRightBt_Section3();
      }
    }
    if( $(this).scrollTop() > 3000 ){
      if(section4 == 0){
        ani_section4();
        section4 = 1;
      }
      else {
        $("#section_4").stop();

        //섹션4 포지션 플래그 함수
        fixRightBt_Section4();
      }
    }
    if( $(this).scrollTop() > 5000 ){
      if(section6 == 0){
        ani_section6();
        section6 = 1;
      }
      else {
        $("#section_6").stop();

      }
    }
    if( $(this).scrollTop() > 6000 ){
      if(section7 == 0){
        ani_section7();
        section7 = 1;
      }
      else {
        $("#section_7").stop();

      }
    }
    if( $(this).scrollTop() > 7000 ){
      if(section8 == 0){
        ani_section8();
        section8 = 1;
      }
      else {
        $("#section_8").stop();

      }
    }

 });

//jQuery 사용자 함수 시작

//섹션 1
  function ani_section1(){

    section1=1;
    section2=0;
    section3=0;
    section4=0;
    section6=0;
    section7=0;
    section8=0;

     setInterval(logo,3000);

  }
    //로고 함수
      function logo () {
        //로고 p
        $(".section01_logo_3").animate({opacity:0},0);
        $(".section01_logo_3").animate({opacity:1},1000);
        $(".section01_logo_3").animate({opacity:1},1000);
        $(".section01_logo_3").animate({opacity:0},1000);
        $(".section01_logo_3").animate({opacity:0},1000);
        $(".section01_logo_3").animate({opacity:0},1000);
        $(".section01_logo_3").animate({opacity:1},5000);
        //로고H
        $(".section01_logo_4").animate({opacity:0},0);
        $(".section01_logo_4").animate({opacity:0},1000);
        $(".section01_logo_4").animate({opacity:1},1000);
        $(".section01_logo_4").animate({opacity:1},1000);
        $(".section01_logo_4").animate({opacity:0},1000);
        $(".section01_logo_4").animate({opacity:0},1000);
        $(".section01_logo_4").animate({opacity:1},5000);
        //로고B
        $(".section01_logo_5").animate({opacity:0},0);
        $(".section01_logo_5").animate({opacity:0},1000);
        $(".section01_logo_5").animate({opacity:0},1000);
        $(".section01_logo_5").animate({opacity:1},1000);
        $(".section01_logo_5").animate({opacity:1},1000);
        $(".section01_logo_5").animate({opacity:0},1000);
        $(".section01_logo_5").animate({opacity:1},5000);

      }

//섹션2

function ani_section2(){

  section1=0;
  section2=1;
  section3=0;
  section4=0;
  section6=0;
  section7=0;
  section8=0;

  $(".section02_title").stop().animate({top:"100px",opacity: 0},0);
  $(".section02_title").stop().animate({top:"254px",opacity: 1},2000);

  $(".section02_box01").stop().animate({opacity:0,top:'0px'}, 0);
  $(".section02_box01").stop().animate({opacity:0,top:'306px'},1500);
  $(".section02_box01").stop().animate({opacity:1,top:'306px'},2000);

  $(".section02_box02").stop().animate({top:"400px",opacity: 0},0);
  $(".section02_box02").stop().animate({top:"400px",opacity: 0},2500);
  $(".section02_box02").stop().animate({top:"575px",opacity: 1},2000);


}

//섹션3 서클
function ani_section3(){

  section1=0;
  section2=0;
  section3=1;
  section4=0;
  section6=0;
  section7=0;
  section8=0;

  $('.first.circle').circleProgress({
    value: 0.85,
    fill:{gradient: ['#fecccc','#ff5f5f']}
  }).on('circle-animation-progress', function(event, progress) {
    // $(this).find('strong').html(Math.round(80 * progress) + '<i>%</i>');
  });


  $('.second.circle').circleProgress({
    value: 0.75,
    fill:{gradient: ['#fecccc','#ff5f5f']}
  }).on('circle-animation-progress', function(event, progress) {
    // $(this).find('strong').html(Math.round(80 * progress) + '<i>%</i>');
  });

  $('.third.circle').circleProgress({
    value: 0.70,
    fill: {gradient: [['#fecccc', .5], ['#ff5f5f', .5]], gradientAngle: Math.PI / 4}
  }).on('circle-animation-progress', function(event, progress, stepValue) {
    // $(this).find('strong').text(stepValue.toFixed(2).substr(1));
  });

   $('.forth.circle').circleProgress({
     value: 0.4,
     fill: {gradient: [['#fecccc', .5], ['#ff5f5f', .5]], gradientAngle: Math.PI / 4}
   }).on('circle-animation-progress', function(event, progress, stepValue) {
    //  $(this).find('strong').text(stepValue.toFixed(2).substr(1));
   });

   $('.fifth.circle').circleProgress({
     value: 0.6,
     fill: {gradient: [['#fecccc', .5], ['#ff5f5f', .5]], gradientAngle: Math.PI / 4}
   }).on('circle-animation-progress', function(event, progress, stepValue) {
    //  $(this).find('strong').text(stepValue.toFixed(2).substr(1));
   });

}


//섹션4
function ani_section4(){

  section1=0;
  section2=0;
  section3=0;
  section4=1;
  section6=0;
  section7=0;
  section8=0;

  $(".section04_txt_01").stop().animate({opacity: 0,left: '800px'},0);
  $(".section04_txt_01").stop().animate({opacity: 1,left: '1020px'},2000);

  $(".section04_txt_02").stop().animate({opacity: 0},0);
  $(".section04_txt_02").stop().animate({opacity: 0},4000);
  $(".section04_txt_02").stop().animate({opacity: 1},1000);


  $(".section04_txt_03").stop().animate({opacity: 0},8000);
  $(".section04_txt_03").stop().animate({opacity: 1},1000);


}
//섹션6
function ani_section6(){

  section1=0;
  section2=0;
  section3=0;
  section4=0;
  section6=1;
  section7=0;
  section8=0;

  $(".section06_title_05").animate({ opacity: 0},0);
  $(".section06_title_05").animate({ opacity: 0},3000);
  $(".section06_title_05").animate({opacity: 1},2000);

  $(".computer01").animate({left: "-500px", opacity: 0},0);
  $(".computer01").animate({left: "0px", opacity: 1},1500);


  $(".section06_tap").animate({left: "-50px", opacity: 0},0);
  $(".section06_tap").animate({left: "-50px", opacity: 0},1500);
  $(".section06_tap").animate({left: "724px", opacity: 1},3000);

  $(".section06_txt").animate({opacity: 0},0);
  $(".section06_txt").animate({opacity: 0},2000);
  $(".section06_txt").animate({opacity: 1},2000);


}

//섹션7
function ani_section7(){

  section1=0;
  section2=0;
  section3=0;
  section4=0;
  section6=0;
  section7=1;
  section8=0;

    $(".section07_title_06").animate({opacity:0},0);
    $(".section07_title_06").animate({opacity:0},2000);
    $(".section07_title_06").animate({opacity: 1},2000);

    $(".phone01").animate({right: "-500px", opacity: 0},0);
    $(".phone01").animate({right: "0px", opacity: 1},1500);

    $(".section07_tap").animate({right: "-50px", opacity: 0},0);
    $(".section07_tap").animate({right: "-50px", opacity: 0},1500);
    $(".section07_tap").animate({right: "566px", opacity: 1},3000);

    $(".section07_txt").animate({opacity:0},0);
    $(".section07_txt").animate({opacity:0},4500);
    $(".section07_txt").animate({opacity: 1},2000);

}

//섹션8
function ani_section8(){

  section1=0;
  section2=0;
  section3=0;
  section4=0;
  section6=0;
  section7=0;
  section8=1;

  $(".section07_title_07").animate({opacity:0},0);
  $(".section07_title_07").animate({opacity:0},2000);
  $(".section07_title_07").animate({opacity: 1},2000);

  $(".macbook01").animate({left: "-500px", opacity: 0},0);
  $(".macbook01").animate({left: "0px", opacity: 1},1500);

  $(".section08_tap").animate({left: "-50px", opacity: 0},0);
  $(".section08_tap").animate({left: "-50px", opacity: 0},1500);
  $(".section08_tap").animate({left: "548px", opacity: 1},3000);

  $(".section08_txt").animate({opacity:0},0);
  $(".section08_txt").animate({opacity:0},4500);
  $(".section08_txt").animate({opacity: 1},2000);


}

});
 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
끄아앙 익스플로러 호환성 문제 [1] 2017.03.20 by 제이와이엔소프트
inseo 스케치북 초보 사용자입니다. 도움 부탁드립니다.  
nick 관리자 로그인이 되지않습니다.  
본드프리 게시판 특정 카테고리 포인트 차감 안하기  
이재훈 게시판에서 블로그가기 [1] file 2017.03.20 by 너에게제공
kmearing 비밀글 게시판에 목록에 안보이게 하기. [2] 2017.03.20 by inhyeparklee
썰툰 사쿠라 인터넷 호스팅 질문합니다  
Chosun.us Xe.1.8.18 버전 reset_mail.html 미존재 에러 [2] 2017.03.19 by mediaq****
강병수 모바일에서 데모페이지 삭제방법을 알고 싶습니다. [2] file 2017.03.19 by 강병수
썰툰 웹사이트 운영시 서버운영에 대해 질문합니다  
NobleMS SQL문 사용하여 XE 회원정보 전송  
menestrello 오픈한 후에 메인화면을 추가수정할 때 사용할 테스트 페이지 어떻게 만드나요?  
밧떼리 스케치북5 게시판 질문... [3] file 2017.03.18 by J__
슈뉴형 미치겠습니다 ㅠㅠ어제까지 사이트 3년째잘돌아가고있었는데 갑자기 404에러가뜹니다...  
인런웨이 xe1.8 팝업창 띄어있는거 교체가능할까요?? [1] 2017.03.18 by J__
쌩왕초보 검색 옵션 관련해서 질문 드립니다  
introasd xe 게시판 중에 이런형태의 게시판이 어떤게있을까요? [2] file 2017.03.17 by 팔공산
오마이갖 초기 TTFB 속도가 너무 느린데요 네임서버도 바꾸고 했는데 이유를 모르겠어요 고수님들 부탁드립니다. [2] file 2017.03.17 by 오마이갖
오마이갖 ssl 적용후 초기 접속 느려지는 현상  
★Da_Mc☆ 관리자 기본URL설정 문제 [1] 2017.03.17 by ★Da_Mc☆
Ashleya9757 비밀글에 달린 비밀댓글이 모두에게 노출됩니다ㅠㅠ  
new_usein 메뉴편집-설정창에 아무것도 안뜹니다. file  
독거노인 mysql 명령으로 글등록을 하고싶습니다. 도와주세요... [2] 2017.03.17 by silhwang
박근선 다국어 전환 질문 드릴께요  
mediaq**** 푸터 구성 문의와 LNB 사이트맵(PC기준) 추가  
킼킼킼 게시판 내용쓰기가 안나와요ㅠㅠ  
hazydusk 이런 사이트는 어떻게 구축하나요? [4] 2017.03.17 by 보쑹아
슈뉴형 멀티미디어 섬네일 애드온 사용중인데 관리자권한만 섬네일이 생성됩니다 ㅠㅠ 도와주세요  
라지 특정 아이디나 등급의 댓글을 최상단으로 복사하기 [2] 2017.03.17 by 라지
nemian 최신 글 댓글 목록 관련해서 문의 드립니다.