I'm getting the following error in Chrome dev console.
Uncaught TypeError: Cannot read property 'top' of undefined jquery.tools.min.js:19
c jquery.tools.min.js:19
a.extend.show jquery.tools.min.js:19
(anonymous function) jquery.tools.min.js:19
b.event.special.(anonymous function).handle jquery.min.js:4
b.event.dispatch jquery.min.js:3
v.handle
If the site is left idle on a page the amount of the errors keeps increasing even with no input from the user. What is causing this?
tab jQuery:
$(document).ready(function () {
$(this).scrollTop(0); //send user to top of page
/***********************************************************************************************************
LOAD TAB CONTENT
***********************************************************************************************************/
$("#tabContent1").load("external/content.html", function () {
$("#offLogo").css({ //apply CSS to offLogo
width: "600px",
margin: "auto",
padding: "0px 0px 10px 0px"
});
});
$("#tabContent2, #tabContent3, #tabContent4, #tabContent5, #tabContent6, #tabContent7").hide(); //hide tab content
$("a").hover(function () {
$(this).toggleClass('hover'); //toggle the hover class when user hovers over tab
});
$('a[name="#tabContent1"]').click(function () { //when user clicks the tab with the name tabContent1 do the following
$("#tab2, #tab3, #tab4, #tab5, #tab6, #tab7").removeClass('activeTab'); //removes the activeTab class from all other tabs
$(this).addClass('activeTab'); //adds activeTab class to the tab that was clicked
$("#tabContent1").load("external/content.html", function () { //loads external html file into content pane of the tab
$("#offLogo").css({
width: "600px",
margin: "auto",
padding: "0px 0px 10px 0px"
});
});
$("#tabContent1").show(); //shows the content of the tab
$("#tabContent2, #tabContent3, #tabContent4, #tabContent5, #tabContent6, #tabContent7").hide();
});
$('a[name="#tabContent2"]').click(function () {
$("#tab1, #tab3, #tab4, #tab5, #tab6, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent2").show();
$("#tabContent1, #tabContent3, #tabContent4, #tabContent5, #tabContent6, #tabContent7").hide();
});
$('a[name="#tabContent3"]').click(function () {
$("#tab1, #tab2, #tab4, #tab5, #tab6, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent3").show();
$("#tabContent1, #tabContent2, #tabContent4, #tabContent5, #tabContent6, #tabContent7").hide();
});
$('a[name="#tabContent4"]').click(function () {
$("#tab1, #tab2, #tab3, #tab5, #tab6, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent4").show();
$("#tabContent1, #tabContent2, #tabContent3, #tabContent5, #tabContent6, #tabContent7").hide();
});
$('a[name="#tabContent5"]').click(function () {
$("#tab1, #tab2, #tab3, #tab4, #tab6, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent5").show();
$("#tabContent1, #tabContent2, #tabContent3, #tabContent4, #tabContent6, #tabContent7").hide();
});
$('a[name="#tabContent6"]').click(function () {
$("#tab1, #tab2, #tab3, #tab4, #tab5, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent6").show();
$("#tabContent1, #tabContent2, #tabContent3, #tabContent4, #tabContent5, #tabContent7").hide();
});
$('a[name="#tabContent7"]').click(function () {
$("#tab1, #tab2, #tab3, #tab4, #tab5, #tab6, #tab7").removeClass('activeTab');
$(this).addClass('activeTab');
$("#tabContent7").show();
$("#tabContent1, #tabContent2, #tabContent3, #tabContent4, #tabContent5, #tabContent6").hide();
});
Tooptip:
$(function () {
$(document).tooltip(); //shows title attribute as a tooltip
});
When you mouse out of the window (say onto the Chrome address bar) and then mouse on to the tab you get the error but if the mouse stays withen the page and mouses over the tab the error does not occur. With some help this has been narrowed down to a problem with the tooptip function.