Update index.js

This commit is contained in:
Harvey Zack committed 2022-05-15 08:16:37 +08:00
1 parent a5cda09e3c
commit 7558d98116
1 file changed
+3 -1
+3 -1
View File
@@ -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: '<img width="22" heigth="22" src="/assets/img/state.svg">',
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;
},