前端中的jktag是什么属性

前端中的jktag是什么属性
2025-05-03 00:32:23
推荐回答(1个)
回答1:

// A helper function so that when we change tab the web view scrolls to the top of the new page
var scrollTop = function () {
setTimeout(function () {
document.body.scrollTop = 0;
}, 0);
}

// This is the method we are going to call when a tab button is pressed
var updateRecipes = function (search) {
scrollTop();
// For now just pop up a message with the tab which was pressed
alert(search);
}

// Set a better title for the topbar
forge.topbar.setTitle("Recipe shopping list");

// Add our 3 tab buttons to the tabbar and add press listeners
var starterButton = forge.tabbar.addButton({
text: "Starters",
icon: "img/tomato.png",
index: 0
}, function (button) {
button.onPressed.addListener(function () {
updateRecipes("starter");
});
// This is the default button, activate it immediately
button.setActive();
updateRecipes("starter");
});

var mainButton = forge.tabbar.addButto