selectors in functions.js not working

1 reply · opened Aug 21, 2020

Aalberto-sibnerAug 21, 2020

Hello,

First of all, thank you for creating this template - it's really great.

I have started to set up a website locally with Canvas and I am having a problem with making the sticky header work properly. After being investigating for a while, I have discovered that the element "<header>" is not getting appended the class "sticky-header" when I scroll down. This is due to an issue with the functions.js file. For some reason, the selectors that are created in lines 2160-2230 are unable to select the HTML elements and are undefined. Could you let me know how to solve this please?

I have attached some screenshots of what my website menu looks like when scrolling down and of what the Javascript console prints putting a "console.log($header)" in the line 2227. In one of the images you can see three numbers:

1 - This is the menu that is not getting fixed when scrolling down.
2 - This is the white background that becomes visible when scrolling down.
3 - This is what the console prints when running "console.log($header)".

Many thanks!

SSemicolon WebSTAFFAug 22, 2020

Hello,

Thanks for the Kind Words! :)

Upon checking the codes from the Screenshots provided we can see that you are using AngularJS which is not officially supported with Canvas. The Default JS Codes from the js/functions.js File runs perfectly fine for the Default HTML Codes and the JS querySelector used appears to be working fine as well, so the issue is related to Customizations and you will need to use the built-in AngularJS methods for selectors.

As AngularJS is currently not in the Supported Platforms for Canvas, unfortunately we cannot provide you further support on this as we currently do not provide Customization related Support according to the Item Support Policy: https://themeforest.net/page/item_support_policy . You will need to manually code this or Hire a Freelancer to help you out.

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard