테스트 사이트 - 개발 중인 베타 버전입니다

제이쿼리 질문좀 ㅠㅠ 채택완료

바트컨트롤 6년 전 조회 2,295

</p>

<p>$(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");

    }

});</p>

<p>//대학진학 탭

$(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;

    });

});</p>

<p>//자격증정보

$(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();

    });

});</p>

<p>

 

이렇게 해놨는데 ㅠ

 

 

이상황입니다 ㅠ

 

도움부탁드릴게요

 

 

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

답변 1개

채택된 답변
+20 포인트
razogol
6년 전

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

 

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

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

 

$(this).offset().top


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

 

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

로그인 후 평가할 수 있습니다

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

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

로그인