Forum de discussion
Forum « Programmation Javascript » (archives)
Re: Probleme taille pop up chromeless
Envoyé: 29 juillet 2004, 4h48 par Hack_Track
<html>
<!--
Author: Philippe Fery
Creation: July 29, 2004
philippefery@hotmail.com
-->
<head>
<title>Sélection d'un répertoire en fonction de la date</title>
<script language="javascript" type="text/javascript">
function ChromelessWindow(width, height, x, y){
var chromelessWin = document.createElement("span");
chromelessWin.id="chromelessWin";
chromelessWin.style.width=width;
chromelessWin.style.height=height;
chromelessWin.style.position="absolute";
chromelessWin.style.zIndex=99;
chromelessWin.style.left=x;
chromelessWin.style.top=y;
chromelessWin.style.lineHeight="140%";
chromelessWin.style.padding="10 10 10 10";
chromelessWin.style.fontSize="12px";
chromelessWin.style.color="#eeeeee";
chromelessWin.style.borderColor="#8888ff";
chromelessWin.style.borderStyle="solid";
chromelessWin.style.borderWidth="1px";
chromelessWin.style.backgroundColor="#eeeeff";
chromelessWin.style.visibility="hidden";
this.chromelessWin=chromelessWin;
this.setLocation=ChromelessWindow_setLocation;
this.setSize=ChromelessWindow_setSize;
this.setContent=ChromelessWindow_setContent;
this.show=ChromelessWindow_show;
this.hide=ChromelessWindow_hide;
this.remove=ChromelessWindow_remove;
}
function ChromelessWindow_setLocation(x,y){
this.chromelessWin.style.left=x+"px";
this.chromelessWin.style.top=y+"px";
}
function ChromelessWindow_setSize(w,h){
this.chromelessWin.style.width=w+"px";
this.chromelessWin.style.height=h+"px";
}
function ChromelessWindow_setContent(html){
this.chromelessWin.innerHTML=html;
}
function ChromelessWindow_hide(){
this.style.visibility="hidden";
}
function ChromelessWindow_show(){
this.chromelessWin.style.visibility="visible";
if(!document.getElementsByName(this.id)[0]){
document.body.appendChild(this.chromelessWin);
}
}
function ChromelessWindow_hide(){
this.chromelessWin.style.visibility="hidden";
}
function ChromelessWindow_remove(){
if(document.getElementsByName(this.id)[0]){
document.body.removeChild(this.chromelessWin);
}
this.chromelessWin=null;
}
</script>
</head>
<body>
<script language="javascript" type="text/javascript">
chromelessWin = new ChromelessWindow(320,200,400,100);
chromelessWin.show();
</script>
<button onclick="chromelessWin.show();">Afficher</button><br>
<button onclick="chromelessWin.hide();">Cacher</button><br>
<button onclick="chromelessWin.remove();">Supprimer</button>
<p>
<textarea id="inputArea"><span style='color: #ff5555; font-size: 24px;'>Test</span><img src='wkf_logo.gif'></textarea>
<br>
<button onclick="chromelessWin.setContent(document.getElementsByName('inputArea')[0].value);">
Modifier le contenu
</button>
<p>
x:<input id="location_X" value="600"> Y:<input id="location_Y" value="55">
<br>
<button onclick="chromelessWin.setLocation(document.getElementsByName('location_X')[0].value,document.getElementsByName('location_Y')[0].value);">
Changer la position
</button>
<p>
Largeur:<input id="size_W" value="200"> Hauteur:<input id="size_H" value="100">
<br>
<button onclick="chromelessWin.setSize(document.getElementsByName('size_W')[0].value,document.getElementsByName('size_H')[0].value);">Changer la taille</button>
</body>
</html>
Réponses
|