게시판 제목 헤더 영역 스크롤시 CSS 변경은 어떻게 하는 건가요? 채택완료
oweowe
2년 전
조회 1,181
게시판 페이지에서 스크롤 하면 list.skin.php 파일에서 #bo_btn_top 영역의 헤더 부분 CSS가 변경 되도록 하고 싶은데 스크립트 적용이 안되는 것 같습니다.
아래는 적용 시킬 기능입니다.
적용시킬 스크립트 https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_shrink_header_scroll
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
2년 전
</p>
<p><script>
// When the user scrolls down 50px from the top of the document, resize the header's font size
window.onscroll = function() {scrollFunction()};</p>
<p>function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
document.getElementById("container_title").style.fontSize = "16px";
} else {
document.getElementById("container_title").style.fontSize = "50px";
}
}
</script></p>
<p>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
o
oweowe
2년 전
이것도 안되는.. 캐시도 지우고 개발자도구에서 수정된 소스 코드도 적용되어있는데도 안되는 것 보면 뭔가 있는 것 같네요..흠;;
�
들레아빠
2년 전
<script>
// When the user scrolls down 50px from the top of the document, resize the header's font size
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
document.getElementById("bo_btn_top").style.fontSize = "16px";
} else {
document.getElementById("bo_btn_top").style.fontSize = "50px";
}
}
</script>
이것이 동작을 안 한다면 해당 보드스킨의 리스트가(list.skin.php) 아닐 수 있습니다.
// When the user scrolls down 50px from the top of the document, resize the header's font size
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
document.getElementById("bo_btn_top").style.fontSize = "16px";
} else {
document.getElementById("bo_btn_top").style.fontSize = "50px";
}
}
</script>
이것이 동작을 안 한다면 해당 보드스킨의 리스트가(list.skin.php) 아닐 수 있습니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인