0

I'm having problem loading the carousel at the bottom of this page: http://bucharestcitytour.com/Treasures_of_Romania_Tour#

First I loaded jQuery and fixed most errors that appeared but now I get an error in Firebug's console that says:

TypeError: crossobj is null

contentheight[contentID]=crossobj.offsetHeight

Tried searching on Google and SO for an answer to this type of problem but couldn't find anything, this is the only similar error that I found TypeError: arr is null and it doesn't have an answer.

What does that error message means and how can I fix it? Please note that I'm a total beginner when it comes to JS/jQuery.

Update:

Here is the code part:

function getInitialSize(contentID,containerID){
    var crossobj=document.getElementById(contentID);
    var crossCobj=document.getElementById(containerID);

    contentheight[contentID]=crossobj.offsetHeight
    contentwidth[contentID]=crossobj.offsetWidth
    containerheight[contentID]=crossCobj.offsetHeight
    containerwidth[contentID]=crossCobj.offsetWidth
    //alert(containerwidth[contentID]);
}

For a better understanding you can check out the link with Firebug and it leads you exactly to the line with the problem, that being contentheight[contentID]=crossobj.offsetHeight.

Community
  • 1
  • 1
Matei Panchios
  • 323
  • 1
  • 6
  • 22
  • 1
    can you show some JS code where you declared `crossobj` ? – J Santosh Sep 23 '15 at 10:56
  • updated to include code – Matei Panchios Sep 23 '15 at 11:01
  • 1
    You are passing `contentID` and/or `containerID` wrong, it's because `getElementById()` returns null and not the DOM object you need. Share the call to this function `getInitialSize()` and we can help you better – Marcos Pérez Gude Sep 23 '15 at 11:03
  • When you are calling the method `getInitialSize` the DOM is not fully loaded. Thats the reason why the element with id `contenty` cannot be found. Please move the calls of `getInitialSize` to an `$(document).ready(function() { ... });` call. – mario.van.zadel Sep 23 '15 at 11:08
  • You are calling getInitialSize('contentz','containerz') from line no 660 in your source code. And FYI there in no html taga with the passed ID's – Furquan Khan Sep 23 '15 at 11:08

0 Answers0