From 7558d981160e2c533c9f4e48111316436632198b Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Sun, 15 May 2022 08:16:37 +0800 Subject: [PATCH] Update index.js --- docs/assets/example/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/assets/example/index.js b/docs/assets/example/index.js index 64b4a32cd..97534413c 100644 --- a/docs/assets/example/index.js +++ b/docs/assets/example/index.js @@ -39,8 +39,8 @@ var art = new Artplayer({ selector: [ { html: 'Display', - switch: true, tooltip: 'Show', + switch: true, onSwitch: function (item) { item.tooltip = item.switch ? 'Hide' : 'Show'; art.subtitle.show = !item.switch; @@ -71,8 +71,10 @@ var art = new Artplayer({ { html: 'Custom Switch', icon: '', + tooltip: 'OFF', switch: false, onSwitch: function (item) { + item.tooltip = item.switch ? 'OFF' : 'ON'; console.info('You clicked on the custom switch', item.switch); return !item.switch; },