2013-03-21 8 views
7
정의되지 않은

의 '왼쪽'. 내가 뭔가 빠진거야?속성을 읽을 수 없습니다 알아낼려고

JS 코드 :

$('.nav li#explorenav a').click(function(){ 
    $('body').animate({scrollLeft: $("#explore").offset().left-15}, 1000, function(){ 
     $(this).parent().addClass('active'); 
    }); 

    return false; 
}); 

$('.nav li#experiencenav a').click(function(){ 
    $('body').animate({scrollLeft: $("#experience").offset().left-15}, 1200, function(){ 
     $(this).parent().addClass('active'); 
    }); 

    return false; 
}); 

HTML 코드 : 사이트의 스크립트에서

<div id="explore"> 
    <div class="Features"> 
     <div class="Feature1" title="The Active Park Assist feature can find parking spaces for you and help manoeuvre your car into them, as if by magic."> 
      &nbsp; 
     </div> 
     <div class="Feature2" title="The luxurious and athletic Interior has sports front seats with red stitching and belts, making you wish the journey never ended"> 
      &nbsp; 
     </div> 
     <div class="Feature3" title="With Collision Prevention Assist and Attention Assist you can rest assured that you’ll get to wherever you’re going, safely."> 
      &nbsp; 
     </div> 
    </div> 
</div> 

<div id="experience"> 
    <div class="Video"> 
     <iframe id="Youtube" width="650" height="366" src="http://www.youtube.com/embed/XS6S8qSMvBE?wmode=opaque" frameborder="0" wmode="transparent" allowfullscreen ALLOWTRANSPARENCY="true"></iframe> 

     <button class="prev">&nbsp;</button> 
     <button class="next">&nbsp;</button> 
     <div class="VideoControls"> 
      <ul class="Vid"> 
       <li id="01" class="Video1" onClick="_gaq.push(['_trackEvent', 'Pulse', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
       <li id="02" class="Video2" onClick="_gaq.push(['_trackEvent', 'Performance', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
       <li id="03" class="Video3" onClick="_gaq.push(['_trackEvent', 'Parking Assist', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
       <li id="04" class="Video4" onClick="_gaq.push(['_trackEvent', 'Flow', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
       <li id="05" class="Video5" onClick="_gaq.push(['_trackEvent', 'Spike', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
       <li id="06" class="Video6" onClick="_gaq.push(['_trackEvent', 'Product film', 'onClick', 'ENGLISH']);"> 
        &nbsp; 
       </li> 
      </ul> 
     </div> 
    </div> 
</div> 
+2

html 코드를 게시 할 수 있습니까? 어쩌면 당신의 HTML에 오자 오류가있어서 $ ("# experience")를 찾을 수 없습니다 – freshbm

+1

우리가 알지 못하는 코드를 참조 할 때 우리는 당신을 도울 수 없습니다 ... –

+0

왜이 jquery가 아닙니까? @ JohannesKlauß – AbdulWahhab

답변

2

는이 코드가 있습니다

$('.nav li#experiencenav a').click(function(){ 
    $('body').animate({scrollLeft: $("#experience .EmptyPage").offset().left-20}, 1200, function(){ 
     $(this).parent().addClass('active'); 
     $('li#homenav, li#discovernav, li#explorenav, li#downloadnav').removeClass('active'); 
    }); 
     return false; 
    }); 

를 그리고 요소 $("#experience .EmptyPage")를 찾을 수 없습니다. 다른 링크 링크 아니라 탐구

<div class="EmptyPage"> 
&nbsp; 
</div> 

그게

이 코드가 일하는 이유 :하지만 당신은이 사업부를 가지고 당신의 #explore 사업부 내부 div에있다.

+0

참으로 저는 지금 그것을 보았습니다. LOL 이것은 모든 일의 압력입니다. P 관리자가 방금 3 일 동안 전체 사이트를 완료했습니다. 고마워요. – AbdulWahhab