Login
     
Getting Started with Template
Building a Website
Starting Template Creation
Layout
Creating Your Layout
Editing The Content Section
Creating & Editing Docker
Positioning
Pages
Create a Page
Page Content Editor
More Features
Widgets
Files & Assets
Designing With Custom CSS
Development With Custom JS
How to Add Fonts
How to Add Images
Navigation
How to Create?
How to Modify Existing Navigation?
How to Set a Navigation?
Snippet
Adding Snippet Template
Add Code to Snippet Template
Data Attribute
Skip-control
Create Snippet
Using Snippets on Page
Responsive Design
Crafting Responsive Content
Crafting a Responsive Header
Hide Grid for Specific Resolutions
Import & Export Guide
Marketplace Template Management
Demo Template
Logo & Favicon
» Development With Custom JS

Development With Custom JS

This folder contains a single JavaScript file. It is important to adhere to the folder and file naming conventions strictly.

To add custom scripting to the template webpage, we need to add a file named config.js in this folder. We can write JavaScript code in this file to customise the webpage behaviour as per our requirements.

This is a ‘Go to Top’ button. We have created this button using an HTML widget and assigned it the class ‘.goToTop’. To implement its functionality, we need to add custom JavaScript code to the ‘config.js’ file. Below is the JavaScript code.

JAVASCRIPT
// GO TO TOP DESIGN
$(function(){
        $(".goToTop").click(function(){
            $('html, body').animate({
                scrollTop: $("body").offset().top
            }, 1000);
            return false;
        });
    }
});

© 2025 WebCommander. All rights reserved. 

  • Terms and Conditions
  • Privacy Policy