RD Navbar Documentation
Integration with Require.js
The script has built-in support of AMD export for integration with Require.js. The whole process of integration combines a few simple steps.
Require.js configuration
First of all, you need to make sure that the configuration of the paths in require.js is correct. It is necessary to define the aliases jquery and jquery.rd-navbar. In most cases, this configuration is defined in the main application script, the path to which is defined in the date data-main attribute when connecting require.js
<script data-main="js/main" src="js/require.js"></script>
The configuration itself must contain the following aliases for paths
requirejs.config({
paths: {
"jquery": "path/to/jquery.min.js"
"jquery.rd-navbar": "path/to/jquery.rd-navbar.min.js"
}
});
Script initialization
It takes you only to use the following code to initialize the script:
requirejs(["jquery", "jquery.rd-navbar"], function($, parallax) {
var o = $(".rd-navbar");
o.RDNavbar({});
});