2012-12-18 4 views
0

site 첫 페이지에 로고가 있지만 스크롤을 시작할 때까지 표시되지 않습니다. 나는 그것을 어떻게 보이게 할 수 있습니까?시차 사이트 - 스크롤 할 때까지 Img가 표시되지 않습니다.

다음
#introwrapper { 
height: 900px; 
position: relative; 
overflow: hidden; 
background: transparent url('images/introbagved.png') no-repeat center; 
} 


#intro{ 
background: url('images/introforan.png') no-repeat center; 
height: 900px; 
width: 1440px; 
margin: 0; 
position: relative; 
z-index: 3; 
} 

#logo{ 
background: transparent url('images/logo.png') no-repeat center; 
width: 400px; 
height: 400px; 
position: absolute; 
margin-left: 520px; 
margin-top: 160px; 
z-index: 2; 
} 

내 JQuery와있다 : 여기

<div id="introwrapper"> 
    <div id="intro"> 
    <!-- <div id="introbaggrundforan"></div>--> 
    <div id="introbaggrundbagved"></div> 
    <a name="section1" class="section1">SECTION 1</a> 
    </div> <!--#intro--> 
<div id="logo"></div> 
다음

내 CSS는 내 HTML입니다

$(document).ready(function(){ 
      $(window).bind('scroll',function(e){ 
       parallaxScroll(); 
      }); 


      function parallaxScroll(){ 
       var scrolledY = $(window).scrollTop(); 
       $('#logo').css('top','+'+((scrolledY*.819))+'px'); 
+0

귀하의 사이트에 대한 링크가 작동하지 않습니다 ... –

답변

0

#logo CSS 규칙에

top:0; 

를 추가합니다.


문제

는 해당 요소의 위치를 ​​정의하지 않은, 그래서 그것은 이전의 요소와 관련하여 ..에 삽입하고이 #intro DIV 후 것입니다.

+0

Thx. 그 트릭을 :) – McKeene

1

나는 당신이 시도하고있는 무슨 생각 끈적 거리는 로고를 만드나요?

$doucment.ready 

한 번 켜십시오. 귀하의 스크롤 이벤트가 IE8의 경우 또한

$("html").scrollTop(); 

을 시도

$(window).scroll(function() { 
    var scrolledY = $(window).scrollTop(); 
    $('#logo').css('top','+'+((scrolledY*.819))+'px'); 
}); 

해야한다, 당신의 HTML이 누락 된 DIV 태그 또한

<div id="introwrapper"> 
    <div id="intro"> 
     <!-- <div id="introbaggrundforan"></div>--> 
     <div id="introbaggrundbagved"></div> 
     <a name="section1" class="section1">SECTION 1</a> 
    </div> <!--#intro--> 
    <div id="logo"></div> 
</div> <-- close this 

을 가지고, 그것은 몇 가지 데이터를 떠날 가장 좋은 방법은 당신의 빈 태그.