181
rated 0 times
[
184]
[
3]
/ answers: 1 / hits: 29289
/ 12 Years ago, fri, november 9, 2012, 12:00:00
While loading a page, I want to get the top of the panel. But it is showing errors.
In Firefox and IE its saying offset() is undefined and in Chrome the error is Uncaught TypeError: Cannot read property 'top' of undefined. Please Help out.
$(window).resize(function () {
tabPanelAdjust();
});
function tabPanelAdjust() {
var theTabPanel = $(.TabPanel);
var tabPanelTop = parseInt(theTabPanel.offset().top);
var winHeight = $(document).height();
tabPanelHeight = winHeight - tabPanelTop;
theTabPanel.css({ min-height: tabPanelHeight - 20 });
}
<div class=TabPanel>
</div>
More From » jquery