답변 2개 / 댓글 1개
Copy
function adjustStyle(width) { width = parseInt(width); if (width < 701) { $("#size-stylesheet").attr("href", "css/narrow.css"); } else if ((width >= 701) && (width < 900)) { $("#size-stylesheet").attr("href", "css/medium.css"); } else { $("#size-stylesheet").attr("href", "css/wide.css"); }}$(function() { adjustStyle($(this).width()); $(window).resize(function() { adjustStyle($(this).width()); });});
답변을 작성하려면 로그인이 필요합니다.
근데 적용이 안되요ㅠㅠ
[code]
//원래코드입니다
<script type="text/javascript" src="js/skrollr.min.js"></script>
<script type="text/javascript">
$(function() {
skrollr.init({
smoothScrolling: true,
smoothScrollingDuration : 400,
forceHeight: false
});
});
</script>
[/code]
이거를
[code]
<script type="text/javascript" src="js/skrollr.min.js"></script>
<script type="text/javascript">
var win_width = $(window).width();
$(function() {
skrollr.init({
if(win_width > 880) {
skrollrBody = 'skrollr-body' //모바일 스크롤 때 필요한 요소
return (/Android|iPhone|iPad|iPod|BlackBerry/i).test(navigator.userAgent || navigator.vendor || window.opera);
} else{
smoothScrolling: true,
smoothScrollingDuration : 400,
forceHeight: false
}
});
});
</script>
[/code]
이렇게 변경하면 되는건가요?ㅜㅜ