묻고답하기

각 섹션의 높에값에 오면 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 남기남
야야야료 통계 자료가 부족합니다 뜹니다.  
Piconik xe 관리자설젙 / 글쓰기 /댓글 등 쓰기가 안될때  
SoundMin XE버전 1.2.4에서 최신XE로 업데이트 방법 [1] 2017.03.15 by sejin7940
salsatour 모바일 글쓰기-첨부파일 버튼오류 [2] file 2017.03.14 by salsatour
심아짐 탑메뉴 위치 문제  
초보중초보 문장위에 워터마크 삽입방법 [2] 2017.03.14 by 초보중초보
Williamhoo 개초보 질문입니다. 디자인관련;;; [1] file 2017.03.14 by 너에게제공
핫빠 댓글에 달기가 안돼요  
happyclo 비회원이 글을 쓸 수는 있지만 삭제는 못 하게 하는 방법이 있을까요? [2] 2017.03.14 by happyclo
모몽 게시판에서 글쓰기를 하면 에디터에 미리 저장해둔 양식이 뜨도록 [1] 2017.03.14 by 제이와이엔소프트
지지 출석부 등수 표기 오류  
lifema**** list.html에서 letter-spacing 수정 문의드립니다 [2] 2017.03.13 by lifema****
lun**** jquery안에 xe문법  
NobleMS XE 회원가입 페이지 수정 [1] 2017.03.13 by HowtoXE
말라위 컨텐츠가 뜨지 않는 오류 [1] 2017.03.13 by HowtoXE
필검 메인화면 슬라이드질문  
홍찬 SEO 모듈에서 추출을 막고 설정한 값만 보이게 하는 방법이 있나요?  
꽃민 시작 메뉴가 포함된 경우 삭제할 수 없습니다.(메뉴삭제가안됩니다) [2] file 2017.03.13 by 꽃민
디비시스 게시판 스킨. 댓글기능 나오도록... file  
new_usein 메인화면을 슬라이드형식으로 변경하는 방법 문의요 file  
쇼퍼 php 5.16 php 5.2 이상으로 업데이트하기  
갓쇼 도와주세요 ㅜㅜ  
new_usein 메인을 슬라이드로 바꾸는방법이요!! [1] 2017.03.13 by 너에게제공
이탐 모바일에서 파일첨부가 안되요 [6] 2017.03.13 by salsatour
silhwang 임의의 문서나 댓글을 수동으로 밀어넣을때요~ file  
Happiness [해결됨]출석부 카운트 모듈 업데이트 안됨  
하나둘셋p 위젯으로 확장변수 출력하는 방법 구합니다. [5] 2017.03.13 by Xe재미나게
김재연 질문합니다.!  
홈런볼11 데이터 이전 [2] 2017.03.12 by 휘즈
awimie 스케치북 모바일버전에서 댓글 폰트를 수정하고싶습니다 file