Cercando di capire il motivo per cui Chrome sta gettando fuori erroreImpossibile leggere proprietà 'left' di indefinito
"Uncaught TypeError: Cannot read property 'left' of undefined"
anche se #explorenav
grandi opere, ma #experiencenav
non sembra funzionare. mi sto perdendo qualcosa?
JS CODICE: CODE
$('.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.">
</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">
</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.">
</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"> </button>
<button class="next"> </button>
<div class="VideoControls">
<ul class="Vid">
<li id="01" class="Video1" onClick="_gaq.push(['_trackEvent', 'Pulse', 'onClick', 'ENGLISH']);">
</li>
<li id="02" class="Video2" onClick="_gaq.push(['_trackEvent', 'Performance', 'onClick', 'ENGLISH']);">
</li>
<li id="03" class="Video3" onClick="_gaq.push(['_trackEvent', 'Parking Assist', 'onClick', 'ENGLISH']);">
</li>
<li id="04" class="Video4" onClick="_gaq.push(['_trackEvent', 'Flow', 'onClick', 'ENGLISH']);">
</li>
<li id="05" class="Video5" onClick="_gaq.push(['_trackEvent', 'Spike', 'onClick', 'ENGLISH']);">
</li>
<li id="06" class="Video6" onClick="_gaq.push(['_trackEvent', 'Product film', 'onClick', 'ENGLISH']);">
</li>
</ul>
</div>
</div>
</div>
Puoi pubblicare il tuo codice html? Forse è errore di battitura nel tuo html e non riesce a trovare $ ("# esperienza") – freshbm
Non possiamo aiutarti ragazzi quando fai riferimento a un codice che non conosciamo ... –
perché non è questo jquery? @ JohannesKlauß – AbdulWahhab