我试图通过使用velo中的show() & hide()函数将按钮和文本分层,为我的吉他课程站点创建一个入门调查问卷。但NeverPlayed单击事件似乎出现了故障,并且没有显示错误。下面是代码和预览链接以供参考。
$w.onReady(function () {
$w('#box1').hide()
});
export function image3_click(event) {
// This is to keep the show box1 on clicking electric guitar's img:
$w('#box1').show();
}
export function NeverPlayed(event) {
// This function is to hide box1 on clicking neverplayed button and showing next question box with text
$w('#box1').hide()
$w('#box2').show()
$w('#text12').show()
}
export function few_months(event) {
// This function is to hide box1 on clicking few months button and showing next question box with text
$w('#box1').hide()
$w('#box3').show()
$w('#text13').show()
}发布于 2021-03-01 20:45:00
函数中的代码看起来没问题。你确定你已经在属性和事件面板中正确地连接了它。您是否尝试过在NeverPlayed()函数的开头添加console.log('anything');以确保它正在运行?
https://stackoverflow.com/questions/66420280
复制相似问题