채택완료

제이쿼리 질문좀 ㅠㅠ

2019-03-29 (금) 23:54:49 2,497
Copy
$(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개

채택된 답변
+20 포인트

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

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

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

$(this).offset().top


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

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

답변을 작성하려면 로그인이 필요합니다.