Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<html>
<head>
<style type="text/css">
.popup_window {
height:398px;
width:398px;
border:1px solid;
position:absolute;
z-index:10000;
}
.popup_head {
height:20px;
background:#f00;
}
.popup_body {
height:358px
background:#0f0;
}
.popup_foot {
height:20px;
background:#00f;
}
</style>
<script type="text/javascript">
function createPopUp() {
var popup = document.createElement("div");
var head = document.createElement("div");
var body = document.createElement("div");
var foot = document.createElement("div");
popup.className = "popup_window";
head.className = "popup_head";
body.className = "popup_body";
foot.className = "popup_foot";
popup.appendChild(head);
popup.appendChild(body);
popup.appendChild(foot);
document.getElementsByTagName("body")[0].appendChild(popup);
}
window.onload = function(){
createPopUp();
}
</script>
</head>
<body>
</body>
</html>
function createPopUp() {
var popup = document.createElement("div");
var head = document.createElement("div");
var body = document.createElement("div");
var foot = document.createElement("div");
popup.className = "popup_window";
head.className = "popup_head";
body.className = "popup_body";
foot.className = "popup_foot";
popup.appendChild(head);
popup.appendChild(body);
popup.appendChild(foot);
document.getElementsByTagName("body")[0].appendChild(popup);
}
//window.onload = function(){ // entfällt
//createPopUp();
//}
<body>
<a href="#" onclick="createPopUp();">createPopUp</a>
</body>
var PopUp = (function(){
var popup_win = null;
var popup = null;
var head = null
var body = null;
var foot = null;
function createPopUp() {
popup = document.createElement("div");
head = document.createElement("div");
body = document.createElement("div");
foot = document.createElement("div");
popup.className = "popup_window";
head.className = "popup_head";
body.className = "popup_body";
foot.className = "popup_foot";
popup.appendChild(head);
popup.appendChild(body);
popup.appendChild(foot);
document.getElementsByTagName("body")[0].appendChild(popup);
return popup;
};
return {
addContent:function(content){
if(!popup_win)
popup_win = createPopUp();
body.innerHTML = content;
return this;
},
display:function(){
if(!popup_win)
popup_win = createPopUp();
popup_win.style.display = "block";
},
hide:function(){
if(popup_win)
popup_win.style.display = "none";
}
};
})();
<a href="#" onClick="PopUp.addContent('Tutorials.de').display();return false;">zeige</a>
<a href="#" onClick="PopUp.hide(); return false;">verstecke</a>