Paddle.Spinner.hide()
Hides a previously called loading spinner.
Use Paddle.Spinner.hide()
to hide a loading spinner that was previously called using Paddle.Spinner.show()
. The spinner appears full screen on a darkened background.
Not needed when working with overlay checkout, as overlay checkout automatically shows a spinner when a checkout is loading.
Typically paired with the Paddle.Spinner.show()
method when loading an inline checkout in response to an event.
Example
This example shows how Paddle.Spinner.hide()
can be called as part of an open checkout function.
eventCallback
is used in Paddle.Initialize()
to call Paddle.Spinner.hide()
when the checkout.loaded
event is emitted.
12345678910111213141516171819201<!-- Checkout button -->
2<button onclick="openCheckout();">Buy</button>
3
4<!-- Inline checkout container -->
5<div class="checkout-container"></div>
6
7<script type="text/javascript">
8 Paddle.Initialize({
9 token: 'live_7d279f61a3499fed520f7cd8c08',
10 // Event callback to hide spinner once `checkout.loaded` is emitted
11 eventCallback: function(data) {
12 console.log(data);
13 if (data.name == "checkout.loaded") {
14 Paddle.Spinner.hide();
15 };
16 }
17 });
18
19 function openCheckout() {
20 var items = [{
Related pages
On this page