I am stuck with this error. Why does Internet Explorer 9 and Chrome version 45 show this error?
Top is undefined
Am I missing something? And some of my HTML layout is also affected in Internet Explorer 9. And also, I don't know if either the font family or width of div in percentage is getting this error. Is there anything to solve this problem?
var bodyScroll = 0;
$(document).ready(function() {
bodyScroll = $(window).scrollTop();
currentP = 0;
currentP1 = 0;
currentP2 = 0;
$(window).scroll(function() {
scrTop = $(window).scrollTop();
bodyScroll < scrTop ? currentP = currentP - .8 : currentP = currentP + .8;
$(".mainContainer, .mobileBanner").css('background-position', "0
" + currentP + "px");
if (scrTop > $("#core-services .core-banner").position().top - 400) {
bodyScroll < scrTop ? currentP1 = currentP1 - .8 : currentP1 = currentP1 + .8;
$("#core-services .core-banner").css('background-position',
"0 " + currentP1 + "px");
}
if (scrTop > $(".core-contact").position().top - 400) {
bodyScroll < scrTop ? currentP2 = currentP2 - .8 : currentP2 = currentP2 + .8;
$(".core-contact").css('background-position', "0 " + currentP2 + "px");
}
bodyScroll = scrTop;
});
});