I 페이지의 특정 요소로 이동하기 위해 jQuery를 스크롤러를 사용하고 활성 속성. 이 경우 Navbar입니다. 그러나 이상한 문제가 발생했습니다. 버튼을 클릭하여 요소로 스크롤 한 후 결과 요소는 focus
속성을 생성합니다.부드러운 스크롤 생성 : 대상 사업부
이 사라지고 내가 클릭 한 요소를 해제합니다 때 다시 나타납니다. 이 위치로 스크롤하려면 단추를 클릭해야만 발생합니다. 나는 초점 태그 사업부를 대상으로하고 .navbar:focus { box-shadow: none;}
를 선언 시도하지만 내가 스크롤 효과를 생성하기 위해 다음과에서 <a href="#navigationtop" class="anchorLink">
jQuery(function($) {
var scrollElement = 'html, body';
$('html, body').each(function() {
var initScrollTop = $(this).attr('scrollTop');
$(this).attr('scrollTop', initScrollTop + 1);
if ($(this).attr('scrollTop') == initScrollTop + 1) {
scrollElement = this.nodeName.toLowerCase();
$(this).attr('scrollTop', initScrollTop);
return false;
}
});
// Smooth scrolling for internal links
$("a[href^='#']").click(function(event) {
event.preventDefault();
var $this = $(this),
target = this.hash,
$target = $(target);
$(scrollElement).stop().animate({
'scrollTop': $target.offset().top
}, 500, 'swing', function() {
window.location.hash = target;
});
});
});
당신은 무엇을 의미합니까 '결과 요소는 초점 속성을 생성'? – MElliott
html 요소의 'focus'속성과 같은 요소는 없으며 요소 자체에 대한 속성을 생성하는 방법은 무엇입니까? 말이되지 않습니다. – MElliott
내가 그것을 클릭하면, 그것이 내가 여기에, 상자 그림자를 추정하지만, 스크롤 버튼을 – memyselfandmyiphone