Initialize eruda.
Name | Type | Desc |
---|---|---|
container | element | Container element. If not set, it will append an element directly under html root element |
tool | string array | Choose which default tools you want, by default all will be added |
autoScale=true | boolean | Auto scale eruda for different viewport settings |
useShadowDom=true | boolean | Use shadow dom for css encapsulation |
var el = document.createElement('div');
document.body.appendChild(el);
eruda.init({
container: el,
tool: ['console', 'elements'],
useShadowDom: true,
autoScale: true
});
Destory eruda.
Note: You can call init method again after destruction.
eruda.destroy();
Set or get scale.
eruda.scale(); // -> 1
eruda.scale(1.5);
Set or get entry button position.
It will not take effect if given pos is out of range.
eruda.position({x: 20, y: 20});
eruda.position(); // -> {x: 20, y: 20}
Get tool, eg. console, elements panels.
var console = eruda.get('console');
console.log('eruda');
Add tool.
eruda.add(eruda.Tool.extend({
name: 'test'
}));
Remove tool.
eruda.remove('console');
Show eruda panel.
eruda.show();
eruda.show('console');
Hide eruda panel.
eruda.hide();