내 페이지 오른쪽에 과도한 가로 스크롤이있는 것 같습니다.전체 너비 부분 2 부
필자는 사이트 상단에있는 스크립트와 관련이 있다고 공언했습니다. 제거하면 문제가 해결됩니다.
내가 달성하기를 기대하는 바를 알려주는 것입니다. 상단의 이미지를 브라우저의 너비를 100 %로 유지하면서 유형을 중앙에 유지하려고합니다.
처음 사이트를 방문하면 내가 말하는 것에 대해 알게 될 것입니다.
<script type="text/javascript">
// The social div
var $socialDiv,
// The social div's height
socialDivHeight = 560,
currentSocialDivHeight = socialDivHeight;
$(document).ready(function() {
$socialDiv = $('.social');
$socialDiv.css({
'background-image': 'url(http://a3.sphotos.ak.fbcdn.net/hphotos-ak-prn1/563655_324264884301748_471368753_n.jpg)',
'background-repeat': 'no-repeat',
'background-attachment': 'fixed',
'background-size' : '110% auto',
'height' : socialDivHeight + 'px',
'margin-left' : '-100%',
'margin-right' : '-100%',
});
});
$(window).scroll(function() {
//Get scroll position of window
var windowScroll = $(this).scrollTop();
var newSocialDivHeight = Math.max(0, socialDivHeight - windowScroll);
if (Math.abs(newSocialDivHeight - currentSocialDivHeight) < 1)
return;
$socialDiv.css({
'opacity' : 1 - windowScroll/400
});
currentSocialDivHeight = newSocialDivHeight;
});
</script>
안녕하세요 이제 jsfiddle 링크를 만들고 html 코드와 css 코드를 넣어주세요. 예 : –
코드를 입력 해주세요. – Vins
야, jsfiddle 도움이 될 것입니다 ... 열심히 그것이 원인이 무엇인지 볼 수 있습니다. 'html, body {width : 100 %}' – neokio