Background-color of ons-page

Developer
Size
2,130 Kb
Views
52,624

How do I make an background-color of ons-page?

Change the background-color of ons-page.. What is a background-color of ons-page? How do you make a background-color of ons-page? This script and codes were developed by Keiji Odagawa on 10 September 2022, Saturday.

Background-color of ons-page Previews

Background-color of ons-page - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>background-color of ons-page</title> <link rel='stylesheet prefetch' href='https://unpkg.com/onsenui/css/onsenui.css'>
<link rel='stylesheet prefetch' href='https://unpkg.com/onsenui/css/onsen-css-components.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ons-navigator id="navigator" page="page1.html"></ons-navigator>
<ons-template id="page1.html"> <ons-page id="first-page"> <ons-toolbar> <div class="center">Page 1</div> </ons-toolbar> <div class="content1" style="text-align: center"> <p>This is the first page1.</p> <ons-button id="push-button1">Push page</ons-button> </div> </ons-page>
</ons-template>
<ons-template id="page2.html"> <ons-page id="second-page"> <ons-toolbar> <div class="center">Page 2</div> </ons-toolbar> <div class="content" style="text-align: center"> <p>This is the page2.</p> <ons-button id="push-button2">Push page</ons-button> </div> </ons-page>
</ons-template>
<ons-template id="page3.html"> <ons-page id="third-page"> <ons-toolbar> <div class="center">Page 3</div> </ons-toolbar> <div class="content" style="text-align: center"> <p>This is the page3.</p> <ons-button id="pop-button">Pop Page</ons-button> </div> </ons-page>
</ons-template> <script src='https://unpkg.com/onsenui/js/onsenui.js'></script> <script src="js/index.js"></script>
</body>
</html>

Background-color of ons-page - Script Codes CSS Codes

#first-page .navigation-bar { background-color: transparent;
}
#first-page .page__background { background-color: gray;
}
#second-page .page__background { background-color: red;
}
#third-page .page__background { background-color: yellow;
}

Background-color of ons-page - Script Codes JS Codes

// Page init event
document.addEventListener('init', function(event) { var nav = document.querySelector('#navigator'); var page = event.target; if (page.matches('#first-page')) { page.querySelector('#push-button1').onclick = function() { nav.pushPage('page2.html'); }; } if (page.matches('#second-page')) { page.querySelector('#push-button2').onclick = function() { nav.pushPage('page3.html'); }; } if (page.matches('#third-page')) { page.querySelector('#pop-button').onclick = function() { var page2 = document.getElementById("second-page"); nav.pageLoader.unload(page2); nav.popPage(); }; }
});
Background-color of ons-page - Script Codes
Background-color of ons-page - Script Codes
Home Page Home
Developer Keiji Odagawa
Username keiji
Uploaded September 10, 2022
Rating 3
Size 2,130 Kb
Views 52,624
Do you need developer help for Background-color of ons-page?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Keiji Odagawa (keiji) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!