1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| <!-- Le javascript -->
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
window.prompt = function(msg){
var promptBox = "";
promptBox +="<div class=\"header\"></div>";
promptBox +="<div id=\"content\" class=\"content\">";
promptBox +=" <div id=\"text\" class=\"text\"></div>";
promptBox +=" <form name='envoi' action='test.php' method='get'><br>";
promptBox +=" <input type='text' name='mot'>";
promptBox +=" <div id=\"ZoneBtn\" class=\"ZoneBtn\"><input type='submit' value='' style=\"cursor:pointer\" class='ok' onclick=\"unshox();\"></div>";
promptBox +=" </form>";
promptBox +="</div>";
promptBox +="<div class=\"footer\" ></div>";
document.getElementById("formTest").innerHTML = promptBox;
shox(msg);
}
function shox(msg)
{
var screenOffsetWidth = getLayoutOffsets()[0];
var screenOffsetHeight = getLayoutOffsets()[1];
document.getElementById('formTest').style.display='';
document.getElementById('formTest').style.position = 'absolute';
document.getElementById('formTest').style.left=(screenOffsetWidth/2)-100 + 'px';
document.getElementById('formTest').style.top=(screenOffsetHeight/2)-150 + 'px';
document.getElementById('text').innerHTML = msg;
FondModal();
}
function unshox()
{
document.getElementById('text').innerHTML = '';
document.getElementById('formTest').style.display='none';
unFondModal();
}
function FondModal()
{
document.getElementById('FondModal').style.display ='';
}
function unFondModal()
{
document.getElementById('FondModal').style.display='none';
}
</script>
<!-- Le HTML && Le PHP -->
<script language="javascript">
prompt('coucou');
</script>
<div id="FondModal" style="position:absolute;left:0;top:0;cursor:not-allowed;width:100%;height:100%;background:url(images/shadow.png);opacity:0.2;filter:alpha(opacity=20);display:none"></div>
<div>On test la fenêtre --> <input type='submit' value='Voir' onclick="prompt('Saisie ton prenom :');"><br>
On test le fond --> <input type='submit' value='Voir' onclick="FondModal()"></div>
<div id="formTest" style="width:220px;display:none"></div>
<?php
if(isset($_GET['mot']))
{
$m = $_GET['mot'];
echo "
<br>
Tu te nomme : $m
<br>
<input type='submit' value='Retour' onclick=\"document.location.replace('test.php')\">
";
}
?> |
Partager