PRODUCT
Follow

adkit.expand(expandProperties) Method

Description

Expands the ad panel.

Example

adkit.onReady(function(){
    adkit.expand({
        panelName: "panel_2",
        useCustomClose: true,
        animate: {
             clip: "rect(0, 100%, 100%, 0)",
             duration: 2000,
             easing: adkit.Animation.Easing.EASE_IN,
             opacity: 1,
             init: {
                   clip: "rect(0, 100%, 0, 100%)",
                   opacity: 0
             }
        } 
    });
});
            

Parameters

Name

Mandatory/Optional

Type

Description

expandProperties

Optional

Object

Contains the Expand properties.

If not defined, and the "show single panel at a time" is set to false, all the panels will expand.

Otherwise, only the default panel will expand.

expandProperties object

Name

Mandatory/Optional

Type

Description

panelName

Optional

String

Name of the panel to expand.

If not defined, and show single panel at a time is false, all panels will expand.

Otherwise, only the default panel will expand.

actionType

Optional

String

Action initiator type. The options include:

  • adkit.ActionType.USER: User initiated. This is the default value.

  • adkit.ActionType.AUTO: Automatically initiated.

useCustomClose

Optional

Boolean

When using InApp serving, you can determine whether to use the standard MRAID close button or a custom button. The default value is false and shows the standard MRAID close button.

animate

Optional

Object

Sets the animation for the expand action.

animate Object Properties

Name

Mandatory/Optional

Type

Description

clip

Mandatory

String

Sets the clip as a string in the CSS.

rect(top, right, bottom, left).

For example: rect(0, 100%, 100%, 0)

opacity

Mandatory

Integer

Sets the opacity in the CSS as an integer.

duration

Mandatory

Integer

Sets the animation duration in milliseconds.

easing

Mandatory

Integer

Sets the animation motion type. The options include:

  • adkit.Animation.Easing.LINEAR

  • adkit.Animation.Easing.EASE_IN

  • adkit.Animation.Easing.EASE_OUT

  • adkit.Animation.Easing.EASE_IN_OUT

init

Mandatory

Object

Defines the animation initial state.

init Object Properties

Name

Mandatory/Optional

Type

Description

clip

Mandatory

String

Sets the clip as a string in the CSS.

rect(top, right, bottom, left).

For example: rect(0, 100%, 100%, 0).

opacity

No

Number

Sets the opacity as a number in the CSS.

Note: To view the Panel Expansion event, see REFERENCE AdKit: onExpand Event.

adkit.collapse(collapseProperties) Method

Description

Collapses the ad panel. The collapsed panel will be removed from the HTML page.

Example

adkit.onReady(function(){
  adkit.collapse({
     panelName: "panel_1",
     actionType: adkit.ActionType.AUTO,
     animate: {
        clip: "rect(0, 100%, 0, 100%)",
        duration: 2000,
        easing: adkit.Animation.Easing.EASE_IN,
        opacity: 0,
        init: {
           clip: "rect(0, 100%, 100%, 0)",
           opacity: 1
        }
     }
   });
});            

Parameters

Name

Mandatory/Optional

Type

Description

collapseProperties

Optional

Object

Contains the collapse properties.

If not defined, all panels will collapse.

collapseParameters Object

Name

Mandatory/Optional

Type

Description

panelName

Optional

String

Name of the panel to collapse.

If not defined, all panels will collapse.

actionType

Optional

String

Action initiator type. Options include:

  • adkit.ActionType.USER: User-initiated. This is the default value.

  • adkit.ActionType.AUTO: Automatically initiated.

animate

Optional

Object

Sets the animation for the collapse action.

animate Object Properties

Name

Mandatory/Optional

Type

Description

clip

Mandatory

String

Sets the clip as a string in the CSS.

rect(top, right, bottom, left).

For example: rect(0, 100%, 100%, 0).

opacity

Mandatory

Integer

Sets the opacity as a number in the CSS.

duration

Mandatory

Integer

Sets animation duration in milliseconds.

easing

Mandatory

String

Animation motion type includes:

  • adkit.Animation.Easing.LINEAR

  • adkit.Animation.Easing.EASE_IN

  • adkit.Animation.Easing.EASE_OUT

  • adkit.Animation.Easing.EASE_IN_OUT

init

Mandatory

Object

Defines the initial state animation.

init Object Properties

Name

Mandatory/Optional

Type

Description

clip

Mandatory

String

Sets the clip as a string in the CSS.

rect(top, right, bottom, left)

For example: rect(0, 100%, 100%, 0)

opacity

Mandatory

Integer

Sets the opacity as a number in the CSS.

Note

To view the Panel Expansion event, see AdKit: Panel Expansion and Collapse Methods.

adkit.showBanner()

Description

Shows the ad banner.

Example

adkit.onReady(function(){
     adkit.showBanner();
});            

adkit.hideBanner()

Description

Hides the ad banner. The banner will reside in the HTML page but will not be visible.

Example

adkit.onReady(function(){
     adkit.hideBanner();
});            

adkit.showPanel(panelName)

Description

Displays the specified ad panel.

Example

adkit.onReady(function(){
     adkit.showPanel("panel1");
});            

Parameters

Name

Mandatory/Optional

Type

Description

panelName

Mandatory

String

Name of the panel you want to show.

adkit.hidePanel(panelName)

Description

Hides the specified ad panel. The panel will reside in the HTML DOM but will be invisible.

Example

adkit.onReady(function(){
     adkit.hidePanel("panel1");            
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments