Uncaught TypeError: Cannot read property 'top' of undefined


I Download a Template “Warehouse - Free Real Estate Listing Website Template 2021 - Colorlib” but I found the next bug:

1.- Choose the mobile view
2.- Select a Property (The index.html works fine, but crash with another webpage like “property-single.html”)
3.- Try to used the menu but doesn´t work.

NOTE: The console show “Uncaught TypeError: Cannot read property ‘top’ of undefined”, and the site stop working.
NOTE 2: If I change to “Browser view”, the site works fine.

I Attached the evidence from the “preview” button from the site “Warehouse - Free Real Estate Listing Website Template 2021 - Colorlib

Can you help me to resolve this issue?

Best regards

Hi there

Yes, your report is valid, I can see this problem, I will report it to our developers, but please consider, this is HTML template and they are provided as-is if you ever worked with HTML templates such problems can be fixed easily

So far, I commented the next line:

<div class=“col-6 d-inline-block d-xl-none ml-md-0 py-3”><span class=“icon-menu h3”></span></div>

With that, I eliminated the menu opción just in mobile view. I can use the links of the footer.

Please let me know when you develop the fix to uncomment the menu option.

Best Regards

Hi There,

Thanks for the follow-up.

At this moment, I’m not able to provide any timelines on how soon this could be resolved.

Hopefully, this issue will be fixed in the coming update.

Have a good one.

Temporary solution:
Open your “warehouse” file and then open “js” folder, then open “main.js” file and press CTRL + F to search for “// navigation

Then copy this code:

  var OnePageNavigation = function() {
	if (window.location.href.indexOf('property-single') !== -1) {
		var main_menu = "";
		var mobile_menu = "";
	else {
		var main_menu = ".main-menu li a[href^='#'],";
		var mobile_menu = ", .site-mobile-menu .site-nav-wrap li a";
    var navToggler = $('.site-menu-toggle');
   	$("body").on("click", <code>${main_menu} .smoothscroll[href^='#'] ${mobile_menu}</code>, function(e) {

When you have copied the code from above, just select all code from “var OnePageNavigation… to … e.preventDefault();” and paste the code that you copied from above.


Open your index.html file and search (CTRL + F) for:
site-mobile-menu site-navbar-target

Then just add another name for class for example:
site-mobile-menu site-navbar-target index_nav

Then open your “main.js” file and CTRL+F for:
.site-mobile-menu .site-nav-wrap li a” and just change “.site-mobile-menu” to:

Hi There,

Thanks a bundle for the follow-up.

I’m going to pass the same to the dev team as well or further consideration.

Have a good one.

Was this issue fixed?

Hi @heram18

Sorry but no, hovewer solution is already posted in this ticket

Ok Thanks. :hugs:

Thank you too and have a good day :slight_smile: