제이쿼리 질문좀 ㅠㅠ

제이쿼리 질문좀 ㅠㅠ

QA

제이쿼리 질문좀 ㅠㅠ

답변 1

본문


$(window).scroll(function() {
    var sTop = $(window).scrollTop()
    //대학정보
    if( sTop >= 200 ){
        $(".tab__ul").addClass("min");
        $(".tab__ul").removeClass("wide");
    } else {
        $(".tab__ul").addClass("wide");
        $(".tab__ul").removeClass("min");
    }
});
//대학진학 탭
$(function(){
    $(".tab__li a").click(function (){
        $(".tab__li a").removeClass("on");
        $(this).addClass("on");
        $('html, body').animate({scrollTop:$($(this).attr("href")).offset().top},500);
        return false;
    });
});
//자격증정보
$(function(){
    $(".content__li2:gt(0)").hide()
    $(".tab__ul2 .tab__li a").click(function(){
        var tabIndex = $(this).parent().index();
        $(".content__li2").hide()
        //alert("aa");
        $(".content__li2").eq(tabIndex).show();
    });
    $(".list__title").next("table").hide();
    $(".content__li2 .list__title").click(function(){
        $("table").hide();
        $(this).next("table").slideDown();
    });
});

 

이렇게 해놨는데 ㅠ

 

 

662179180_1553871271.1977.png

이상황입니다 ㅠ

 

도움부탁드릴게요

 

 

이 질문에 댓글 쓰기 :

답변 1

$('html, body').animate({scrollTop:$($(this).attr("href")).offset().top},500);

 

$($(this).attr("href"))

이 부분이 잘못 되었습니다.

 

$(this).offset().top


$('html, body').animate({scrollTop:$(this).offset().top},500);

 

어디 위치로 가고 싶으 신건가요 ?

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 125,873
© SIRSOFT
현재 페이지 제일 처음으로