Back to Top

Hype GlobalBehavior master

This module allows to extend custom behavior across Hype document and iFrame boundaries containing Hype documents. There is also an implementation making this work across devices using Pusher. The function not listed in the JSDoc is the one mainly leveraged in this extension is hypeDocument.triggerCustomBehaviorNamed and is part of the official API. Hence the function is essential but not listed in the JSDocs of this extension.

hypeDocument.startCustomBehaviorTicker(behavior, time, options)

Starts a custom behavior ticker. This is an interval based trigger that offers an optional tick pattern

hypeDocument.startCustomBehaviorTicker('clockhand',1);
hypeDocument.startCustomBehaviorTicker('ticktacktockwait', 0.5, {pattern: [true, true, true, false]});

Parameters

Name Type Description
behavior String

This is the custom behavior name to we want to start the ticker for

time Number Object

The time in in seconds (can be fractional) or an object with an FPS attribute {FPS:10}

options Object

Some optional settings like pattern and omit first call

options.pattern Array

This is an array containg an array with true or false to form a pettern

options.omitFirst Boolean

I this is set to true the first call, directly fired when starting will be omitted

Returns

Void

hypeDocument.stopCustomBehaviorTicker(behavior)

Stops a custom behavior ticker.

hypeDocument.stopCustomBehaviorTicker('clockhand');

Parameters

Name Type Description
behavior String

This is the custom behavior name to we want to stop the ticker for

Returns

Void

hypeDocument.stopAllCustomBehaviorTicker(behavior)

Stops all custom behavior tickers across the current HTML document

hypeDocument.stopCustomBehaviorTicker('clockhand');

Parameters

Name Type Description
behavior String

This is the custom behavior name to we want to stop the ticker for

Returns

Void

HypeGlobalBehavior()

Properties

Name Type Description
version String

Version of the extension

allowPostMessageFrom Function

This function allows to limit the iFrame parents by domain that can communicate with the Hype documents contained in the current window using global behavior

triggerCustomBehaviorNamed Function

This function allows to trigger a custom behavior from the window scope. The signature is equal to hypeDocument.triggerCustomBehaviorNamed

startCustomBehaviorTicker Function

This function allows to start a time based global behavior ticker from the window scope. The signatur is equal to hypeDocument.startCustomBehaviorTicker

stopCustomBehaviorTicker Function

This function allows to stop a time based global behavior ticker from the window scope. The signatur is equal to hypeDocument.stopCustomBehaviorTicker

stopAllCustomBehaviorTicker Function

This function allows to stop all time based global behavior ticker from the window scope. The signatur is equal to hypeDocument.stopAllCustomBehaviorTicker

Returns

Void