Discount Ninja
Search
K

Progress bar

Attributes

animation-on-progress (string)
  • none: [default] no animation
  • smooth: causes the bar to be filled smoothly

Methods

render: renders the progress bar based on the messages received
  • Parameters:
    • message (object):
      • progress (number) [required]: the progress towards the next goal as a percentage
      • nextGoal (string): the message to be displayed in the "Next goal" section in text or HTML
      • goals (object[]):
        • token (string) [required]: the token of the associated Discount Ninja offer
        • unlocked (boolean): true indicates the goal has been achieved
        • message (string): the message to be displayed in the "Goal" section in text or HTML
  • Example:
{
"progress": 80,
"nextGoal": "Add $20 to get free shipping",
"goals": [
{
"message": "Free gift",
"token": "ABCD",
"unlocked": true
},
{
"message": "Free shipping",
"token": "EFGH",
"unlocked": false
}
]
}

Events

la:dn:drawer-cart-progress-bar:render
  • Executes the render method.
Last modified 8mo ago