使用指南
按照下面的步骤即可引入此插件并让其顺利的运行。如果在使用过程中发现bug,请提交到GitHub issues.
引入文件
添加标签
启动此插件
var navigation = responsiveNav("#nav");
调整参数
var navigation = responsiveNav("#nav", { // Selector: The ID of the wrapper
animate: true, // Boolean: 是否启动CSS过渡效果(transitions), true 或 false
transition: 400, // Integer: 过渡效果的执行速度,以毫秒(millisecond)为单位
label: "Menu", // String: Label for the navigation toggle
insert: "after", // String: Insert the toggle before or after the navigation
customToggle: "", // Selector: Specify the ID of a custom toggle
openPos: "relative", // String: Position of the opened nav, relative or static
jsClass: "js", // String: 'JS enabled' class which is added to el
debug: false, // Boolean: Log debug messages to console, true 或 false
init: function(){}, // Function: Init callback
open: function(){}, // Function: Open callback
close: function(){} // Function: Close callback
});
可调用的方法
// 销毁插件
navigation.destroy();
// Toggle
navigation.toggle();