Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Custom javascript

ninedoors premium asked 5 years ago


How do I add custom javascript to MDB?


MDBootstrap staff answered 5 years ago


Hi ninedoors,

We have plenty of possibilities to achieve that.

Simple: script tag and add another source of code after MDB.min.js.

Efficient: Edit MDB.js by adding your code and use minifier to keep package small.

Advanced: Use Gulp MDB package and modify the config to pack only required elements and add your own source of code to be added to the package.

If you need any help I am here for you.

Best Regards, Piotr


ninedoors premium commented 5 years ago

I am using Gulp to combine all the js files. I am wondering how I can add a folder of custom js files to do that same thing? I created the folder in the js folder and named is custom. I want to create the custom files and subfolders in this folder and combine them and minimize them into a custom.min.js file. Then I will add that file in my footer html file. I hope that makes sense.


Bartłomiej Malanowski staff commented 5 years ago

Please take a look at modules.js located in the "js" directory. In this place, you can link your custom JavaScript file. Then, just simply run gulp js-build and gulp js-minify



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.8.1
  • Device: Web
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No