You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constbehaviour=()=>{// Get constructor objectconstobject=newJFlow({configParam: "this is a config param"})// Returns a promise, don't blocks executionreturnobject.listener(controlParams);}
The way you initialize main method and call all handle functions:
All behaviours / handlers must be wrapped inside a function.
// Main methodwindow.addEventListener("load",()=>{initLogicApp().then(initSomeMenu()).then(initLightbox()).then(console.log("And you are ready to use JFlow!"));});
Custom Build Examples.
Create a custom Handle object:
Can pass multiple config objects for trigger it at the same time.
// Object constructor waits for objects// with element id and css classNameconsthtmlElement=newHandler({element: "idString1",css: ["className1","className2"]},{element: "idString2",css: "uniqueAnimation"});
Trigger events must be returned in a execution context.
// Set js styles with a className// returns the array of elementsconststyledElement=newStyle({display: "flex",justifyContent: "center",alignItems: "center",width: "100vw",height: "100vh",backgroundColor: "tomato"}).setStyle("htmlClassName");
Create a custom Parallax object
// direction can be negative// offset specifies minOffset to trigger// can ba multiple objectsconsthtmlElement=newParallax({target: "targetId",direction: -1.2,offset: 100});// starts event listenerreturnhtmlElement.listen();