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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| <?php $id=$_GET['id']; $pseudo= $_GET['pseudo']; $contact=$_GET['contact'];?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel='stylesheet' href='sample.css' type='text/css'>
<style type='text/css'>
.dragme { cursor: move }
</style>
<script type='text/javascript'>
var ie = document.all;
var nn6 = document.getElementById &&! document.all;
var isdrag = false;
var x, y;
var dobj;
function movemouse( e ) {
if( isdrag ) {
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
}
}
function selectmouse( e ) {
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";
while (fobj.tagName != topelement && fobj.className != "dragme") {
fobj = nn6 ? fobj.parentNode : fobj.parentElement;
}
if (fobj.className=="dragme") {
isdrag = true;
dobj = document.getElementById("styled_popup");
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = nn6 ? e.clientX : event.clientX;
y = nn6 ? e.clientY : event.clientY;
document.onmousemove=movemouse;
return false;
}
}
function styledPopupClose() {
document.getElementById("styled_popup").style.display = "none";
}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
// rechargement de message reçu
function descendreTchat(){
// Marche pas -> var scroll_top = parent.frames["tchat"].scrollHeight;
parent.frames["private"].scrollBy(0,999999);
}
function showMessage(){
var x_object2 = null;
if(window.XMLHttpRequest){
x_object2 = new XMLHttpRequest();
}else if(window.ActiveXObject){
x_object2 = new ActiveXObject("Microsoft.XMLHTTP");
}else{
alert('Votre navigateur de supporte pas la technologie AJAX(XMLHttpRequest)...');
return;
}
x_object2.open("POST","private_box.php?id=<?php echo $id; ?>",true);
x_object2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
x_object2.send(null);
x_object2.onreadystatechange = function(){
if(x_object2.readyState==4){
if(x_object2.status==200){
parent.frames["private"].document.body.innerHTML = x_object2.responseText;
descendreTchat();
Layer1.style.visibility="hidden";
}
}
}
}
setInterval(showMessage,1000);
</script>
</head>
<body onLoad="descendreTchat()">
<h1>DHTML Popups Sample 06</h1>
<div id='styled_popup' name='styled_popup' style='width: 480px; height: 350px; display:none; position: absolute; top: 100px; left: 700px;'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='456' src='images/x11_title.gif' class='dragme'></td>
<td><a href='javascript:styledPopupClose();'><img height='23' width='24' src='images/x11_close.gif' border='0'></a></td>
</tr>
<tr><td colspan='2' style='background: url(images/x11_body.gif) no-repeat top left; width: 460px; height: 340px;'>
<table width="470">
<tr>
<td width="308" height="285"><table width="304">
<tr>
<td width="296" height="153"><iframe name="private" id="private" src="default.html" width="300" heigh="100%" scrolling="Auto"></iframe></td>
</tr>
<tr>
<td height="90"><iframe src="private_message.php?id=<?php echo $id; ?>&contact=<?php echo $contact; ?>&pseudo=<?php echo $pseudo; ?>" name="chat" width="300" scrolling="No" id="chat" heigh="100"></iframe></td>
</tr>
</table></td>
<td width="150"><iframe src="rooms.php?pseudo=<?php echo $pseudo; ?>" name="rooms" width="100%" height="305" scrolling="Auto" id="rooms"></iframe></td>
</tr>
</table>
</td></tr>
</table>
</div>
<input type='submit' onClick='document.getElementById("styled_popup").style.display="block"' value=' Fire! '>
</body>
</html> |
Partager