1
아래 코드는 Chrome에서 정상적으로 작동하지만 Safari에서 다음과 같은 오류가 발생합니다. 그것을 해결할 수있는 해결책이 있습니까?TypeError : undefined가 Safari 및 iOS에서만 사용되는 객체가 아닙니다.
jQuery('.mk-responsive-nav > li > a').click(function() {
var href = jQuery(this).attr('href').replace('#', '');
jQuery(window).scrollTop(jQuery("section[data-anchor='" + href + "']").offset().top);
console.log(jQuery("section[data-anchor='" + href + "']").offset().top );
});
사파리 오류 :
오류 : 미정은 (평가 대상 아니다 'jQuery를 ("절 [데이터 앵커 ='"+ HREF가 + ''] "..) (오프셋) 위쪽 ')