Parameters |
Type |
Description |
innerHtml |
string |
The dom string |
Return |
Element The web element |
const element = createElement(<div/>);
Parameters |
Type |
Description |
element |
Element |
The target element |
element |
string |
The event type |
element |
Function |
The handler function |
Return |
Function The function which is used to unregister the event handler |
const unregisterFn = registerEvent(body, 'click', (e) => {});
Parameters |
Type |
Description |
element |
Element |
The target element |
element |
Object |
The event/handler object |
Return |
Function The function which is used to unregister the event handler |
const unregisterFn = registerEvents(body, { 'click', (e) => {} });
Parameters |
Type |
Description |
maxSize |
Object |
The maximum size of size |
aspect |
Number |
The aspect ratio |
callback |
Function |
The handler function |
Return |
Function The function which is used to unregister the event handler |
const maxSize = {
width: window.innerWidth,
height: window.innerHeight
};
const aspect = 16 / 9;
const size = calculateSizeByAspect(maxSize, aspect);
Parameters |
Type |
Description |
svgText |
string |
The svg xml text |
options |
Object |
[optional] {MaxWidth, MaxHeight} |
Return |
Object The ImageAdapter |
const imageAdapter = svgToImage(svgText, options);
Parameters |
Type |
Description |
element |
Element |
The target element |
name |
Object |
{fromValue, toValue, animationTime, propertyName} |
const element = document.querySelector('.scroll');
const fromValue = 0;
const toValue = 800;
const animationTime: 300;
const propertyName = 'scrollLeft';
scrollTo(element, {fromValue, toValue, animationTime, propertyName});