Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

GESTIONNAIRE DE FENETRE (BOUGER, REDIMENTIEONNER,TOURNER, RENDRE TRANSPARENT)


Information sur la source

Catégorie :Trucs Amusants Niveau : Débutant Date de création : 02/03/2004 Date de mise à jour : 02/03/2004 16:28:02 Vu / téléchargé: 9 256 / 920

Note :
8,25 / 10 - par 4 personnes
8,25 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (7)
Ajouter un commentaire et/ou une note

Description

Cliquez pour voir la capture en taille normale
Voila un groupe de script qui m'ont pris un peu de temps, et en fait j'ai pas encore trouvé quoi en faire, donc voila si vous trouvez dites le moi...
ATTENTION C'EST POUR IE 5.5 mini et  j'ai mis la page exemple en ASP c'est plus simple mais les scripts sont en Javascript...

Donc la, on gere des fenetres (2 dans l'exemple) dans le navigateur on les bouge, on les redimentionne on les fait tourner et on les rend transparentes (ulisez les boutons en haut a droite pour les deux dernieres fonctions)...

En gros c'est une base apres vous en faites ce que vous voulez...
 

Conclusion

Si vous avez des questions j'y répondrais ...
 

Fichier Zip

Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip

Commentaires et avis

signaler à un administrateur
Commentaire de ThunderPsycho le 03/03/2004 10:10:53

C vrai que question utilité... moi non plus je n'ai pas d'idée ;o)
Mais je suis sur que ca servira à qqun...

A part ça, la source reste vraiment pas mal est en fait toute simple. C sympa. Just deux choses :
- Ca serait pas mal d'ajouter une fonction pour effectuer une rotation avec la souris, en l'activant lorsque la souris est présente près de l'angle de l'image
- Et les manipulations sont lourdes, et ca en chie pas mal ( j'imagine meme pas pour une rotation à la souris ;o) ). si tu veux avoir un bon gain en performances, oublies les fonctions et les variables asp et fait tout  en javascript, je m'explique :
Le truc qui  fait le plus cracher ton serveur c'est le fait d'appeler de l'asp sans arrêt ( à chaque fois que tu effectues <%%> ). Tu obliges, lors de la compilation, ton serveur à basculer entre le compilateur asp et l'interpréteur html à chaque appel, ce qui constitue une manip lourde et qui fait perdre bcp de temps lors de l'envoi de ta page au client.

Voila, 9/10

signaler à un administrateur
Commentaire de le_chacal le 03/03/2004 10:36:43

Merci pour le comment...
J'avais pensé à faire la rotation à la souris mais tant que j'ai pas une fonction super nickel d'interception des mouvements je vais m'abstenir
je vais surement me repencher dessus pour fignoler et rajouter des fonctions
Pour ce qui est de l'asp la c'étais juste pour les essais , c'est sur que d'habitude  c'est plus propre mais la le but c'est pas l'ASP et en plus y en a pas beaucoup alors je me suis pas pris la tête je l'ai laissé tel quel...Sorry ;-)
++

signaler à un administrateur
Commentaire de iubito le 08/03/2004 06:56:28

tu l'a fais en asp, j'ai pas de serveur asp, tu peux balancer une url pour le tester ?

signaler à un administrateur
Commentaire de le_chacal le 08/03/2004 09:30:18

Ben non sorry j'ai fait ca pendant le développement d'un intranet et le serveur dont je me sers pour le dev est sur mon portable...mais le code est facilement transformable en PHP ou full javascript, c'est juste pour récupérer les données du formulaire (taiiles des fenetres , image et texte )

++

signaler à un administrateur
Commentaire de babid le 11/03/2004 10:37:41

Salut,

Tout d'abord, sympa ta source le_chacal, manque peut etre des commentaires pour les debutants, sinon je te mets 9/10 car ca les merite.

Ibuto, j'ai repris son code et je l'ai mis en php, le voila :

//-------------------------------------------------------------------------//
<?
function NewDiv ($La,$Lo,$Typ,$Cont,$Nom){
$PosT = 200;
$PosL = 200;
?>
<DIV  ID="<? echo $Nom ?>" STYLE="z-index:10;position: absolute; top:<? echo $PosT; ?>; Left: <? echo $PosL; ?>; width: <? echo $La ?>; height: <? echo $Lo ?>;filter:Shadow(Color=#909090, Direction=120) ;" >
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" STYLE="border-collapse: collapse" BORDERCOLOR="#111111" WIDTH="100%" HEIGHT=100% ID="AutoNumber1">
   <TR onMouseOver="this.style.cursor='move';"  onMouseDown="Target=document.all('<? echo $Nom ?>');Bouge(Target);" onMouseUp="Release();">
     <TD WIDTH="3" HEIGHT=3><IMG BORDER="0" SRC="Pict/Cadre/TL.gif" WIDTH="5" HEIGHT="21"></TD>
     <TD BGCOLOR=#ECE8D8 BACKGROUND="Pict/Cadre/Top.gif"><FONT SIZE=1 COLOR=#FFFFFF><? echo $Nom ?></FONT></TD>
     <TD WIDTH="3" HEIGHT=3><IMG BORDER="0" SRC="Pict/Cadre/TR.gif" WIDTH="4" HEIGHT="21"></TD>
   </TR>
   <TR>
     <TD BGCOLOR=#ECE8D8 BACKGROUND="Pict/Cadre/Left.gif"></TD>
     <TD BGCOLOR="#FFFFFF" VALIGN=top>
<? if ($Typ=="txt") { echo $Cont; }else {
?>
  
<IMG SRC="<? echo $Cont ?>" WIDTH="100%" HEIGHT="100%">   
<? } ?>    
     </TD>
     <TD BGCOLOR=#ECE8D8 BACKGROUND="Pict/Cadre/Right.gif"></TD>
   </TR>
   <TR>
     <TD WIDTH="3" HEIGHT=3><IMG BORDER="0" SRC="Pict/Cadre/BL.gif" WIDTH="5" HEIGHT="16"></TD>
     <TD BGCOLOR=#ECE8D8 BACKGROUND="Pict/Cadre/Bottom.gif"></TD>
     <TD WIDTH="3" HEIGHT=3><IMG BORDER="0" SRC="Pict/Cadre/BR.gif" WIDTH="4" HEIGHT="16"></TD>
   </TR>
</TABLE>
<DIV ID="CloZ<?  echo $Nom ?>" onMouseOver="this.style.cursor='hand'" onClick="Target=document.all('<?  echo $Nom ?>');Target.style.display='none'; " STYLE="z-index: 11;position: absolute;top: 5;right: 7"><IMG ALT="Fermer..." SRC="pict/cadre/cloz.gif"></DIV>
<DIV ID="ResiZ<?  echo $Nom ?>"  onMouseDown="Target=document.all('<? echo $Nom ?>');ChangeTaille(Target);" onMouseUp="Release();" STYLE="z-index: 11;position: absolute;cursor:se-resize;Bottom: 4;right: 3; width:10;height : 10;"><TABLE ALT="Taille..." BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=10 HEIGHT=10><TR><TD BACKGROUND="pict/cadre/resiz.gif" ></TD></TR></TABLE></DIV>  
<DIV ID="Rotat<?  echo $Nom ?>" onMouseOver="this.style.cursor='hand'" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');if (Target.style.display=='none'){Target.style.display='';}else{Target.style.display='none';} " STYLE="z-index: 11;position: absolute;top: 5;right: 20"><IMG  ALT="Rotation..." SRC="pict/cadre/rotate.gif"></DIV>
<DIV ID="ChoixAng<?  echo $Nom ?>" STYLE="position:absolute;Top:15;Right:10;width:45;display:'none'">
<TABLE WIDTH=100% BGCOLOR=#ECE9D8 STYLE="border-width:1;border-style: solid;" BORDERCOLOR=#505050>
<TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',0);Target.style.display='none';"><FONT SIZE=2>0 °</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',10);Target.style.display='none';"><FONT SIZE=2>+ 10 °</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',30);Target.style.display='none';"><FONT SIZE=2>+ 30 °</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',60);Target.style.display='none';"><FONT SIZE=2>+ 60 °</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',120);Target.style.display='none';"><FONT SIZE=2>+ 120 °</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixAng<?  echo $Nom ?>');rotate('<?  echo $Nom ?>',180);Target.style.display='none';"><FONT SIZE=2>+ 180 °</FONT></TD>
</TR>
</TABLE>
</DIV>
<DIV ID="Degrad<?  echo $Nom ?>" onMouseOver="this.style.cursor='hand'" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');if (Target.style.display=='none'){Target.style.display='';}else{Target.style.display='none';} " STYLE="z-index: 11;position: absolute;top: 5;right: 32"><IMG  ALT="Transparence..." SRC="pict/cadre/degrad.gif"></DIV>
<DIV ID="ChoixDeg<?  echo $Nom ?>" STYLE="position:absolute;Top:15;Right:20;width:45;display:'none'">
<TABLE WIDTH=100% BGCOLOR=#ECE9D8 STYLE="border-width:1;border-style: solid;" BORDERCOLOR=#505050>
<TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',100,0,100);Target.style.display='none';"><FONT SIZE=2>100%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',90,0,100);Target.style.display='none';"><FONT SIZE=2>90%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',80,0,100);Target.style.display='none';"><FONT SIZE=2>80%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',70,0,100);Target.style.display='none';"><FONT SIZE=2>70%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',60,0,100);Target.style.display='none';"><FONT SIZE=2>60%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',50,0,100);Target.style.display='none';"><FONT SIZE=2>50%</FONT></TD>
</TR><TR>
<TD onMouseOver="this.style.cursor='hand';this.bgColor='#BCBBE6';" onMouseOut="this.bgColor='#ECE9D8';" onClick="Target=document.all('ChoixDeg<?  echo $Nom ?>');TransParent('<?  echo $Nom ?>',40,0,100);Target.style.display='none';"><FONT SIZE=2>40%</FONT></TD>
</TR>
</TABLE>
</DIV>

</DIV>



<? $PosT = $PosT + 20;
$PosL = $PosL + 20;
}
?>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Microsoft FrontPage 5.0">
<META NAME="ProgId" CONTENT="FrontPage.Editor.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Nouvelle page 1</TITLE>

<SCRIPT language="Javascript1.2">

var Objet;
var DecX = 0;
var DecY = 0;
var PosX = 0;
var PosY = 0;
var Type = "";
var Angle = 0;

function Bouge(Obj) {
if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
Objet = Obj;
if (Objet) {
Decal();
   document.onmousedown = OnDown;
   document.onmouseup = Release;
   }
}
function OnDown () {
if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
if (Type == "MOVE") {
document.onmousemove = posit;
} else if (Type == "RESIZE") {
document.onmousemove = defTaille;
}
   document.onmouseup = Release;
}
function Decal() {
Type = "MOVE";
if (Objet) {
OldX = parseInt(Objet.style.left);
OldY = parseInt(Objet.style.top);
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
DecX = x - OldX;
DecY = y - OldY;
} else {
return -1;
}
}
function Release() {
Objet = 0;
}
function posit(){
if (Objet) {
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
NewX = x - DecX;
NewY = y - DecY;
window.status = Objet.id+"(X="+NewX+",Y="+NewY+")";
moveIt(NewX,NewY);
} else {
return -1;
}
}
function moveIt(x,y){
if (Objet) {
Objet.style.top =  y;
Objet.style.left = x;
} else {
return -1;
}
}
function ChangeTaille(Obj) {
if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
Objet = Obj;
if (Objet) {
RepereIt();
   document.onmousedown = OnDown;
   document.onmouseup = Release;
   }
}
function RepereIt() {
Type = "RESIZE";
if (Objet) {
PosX = parseInt(Objet.style.left);
PosY = parseInt(Objet.style.top);
}
}
function defTaille () {
if (Objet) {
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
Wd = (PosX - x)*(-1);
He = (PosY - y)*(-1);
ResizeIt(Wd,He);
} else {
return -1;
}
}
function ResizeIt(Wd,He) {
if (Wd > 30 && He > 40) {
Objet.style.width=Wd;
Objet.style.height=He;
}
}
function degToRad (angle) {
angle = (angle/ 180) * 3.142;
return angle;
}
function rotate(name, angle){
//convert angle into radians
     var rad = degToRad(angle);

     //calculate cos and sin of the angle
     costheta = Math.cos(rad);
     sintheta = Math.sin(rad);

     //create object reference
     var Target = document.getElementById(name);
     if(Target) {
         //apply the filter
         Target.style.filter = "progid:DXImageTransform.Microsoft.Matrix();";

         //set up the properties
         Target.filters.item("DXImageTransform.Microsoft.Matrix").SizingMethod = "auto expand";
         Target.filters.item("DXImageTransform.Microsoft.Matrix").FilterType = "bilinear";

        //apply the rotation matrix transformation
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M11 = costheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M12 = -sintheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M21 = sintheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M22 = costheta;
    }    
}
function TransParent(name,Begin,Type,End) {
var Target = document.getElementById(name);
if (Target) {
Target.style.filter="Alpha";
Target.filters.item("Alpha").opacity = Begin;
Target.filters.item("Alpha").FinishOpacity = End;
Target.filters.item("Alpha").Style = Type;
}
}
function MagicEffect(Name,Angle,Mir,Inv,Xray,Gray,Opac) {
var Target = document.getElementById(Name);
if (Target) {
Target.style.filter = "progid:DXImageTransform.Microsoft.BasicImage();";

Target.filters.item("DXImageTransform.Microsoft.BasicImage").Rotation = Angle;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Mirror = Mir;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Invert = Inv;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").XRay = Xray;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Grayscale = Gray;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Opacity = Opac;
}
}
</SCRIPT>

</HEAD>
<BODY>

<? $Tst = $Test;
if ($Tst == "True"){  ?>
<DIV ID=LesCalques  STYLE="z-index: 10; width: 100% ; height: 100% ;filter:Shadow(Color=#909090, Direction=120) ;">

<?
$La = $Larg;
$Lo = $Long;
$Img = $Img;
$La1 = $Larg1;
$Lo1 = $Long1;
$Txt = $Texto;
if ($La!="" && $Lo!="" && $Img!=""){
NewDiv ($La,$Lo,"Img",$Img,"Image 1");
}
if ($La1!="" && $Lo1!="" && $Txt!=""){
NewDiv ($La1,$Lo1,"txt",$Txt,"Texte 1");
}
?>
</DIV>
<? } ?>


<DIV STYLE="z-index: 2;position: absolute;top: 0;Left:0;">
<FORM METHOD="POST" NAME=Form1 ACTION="Test.php" >
<INPUT TYPE=hidden NAME=Img VALUE="">
<INPUT TYPE=hidden NAME=Test VALUE="True">
    Image :<P>Largeur : <INPUT TYPE="text" NAME="Larg" SIZE="6">      
  Longueur : <INPUT TYPE="text" NAME="Long" SIZE="6">          
  <INPUT TYPE="button" VALUE="Créer" NAME="B1" onClick="Img.value=CImg.value;Form1.submit();"></P>
    <P>Image :</P>
  <P><INPUT TYPE="file" NAME="CImg" SIZE="67"></P>
  <P>Texte :</P>
  <P>Largeur : <INPUT TYPE="text" NAME="Larg1" SIZE="6">      
  Longueur : <INPUT TYPE="text" NAME="Long1" SIZE="6">       </P>
  <P>Texte :</P>
  <P><TEXTAREA ROWS=6 NAME=Texto COLS=81></TEXTAREA><SCRIPT language="JavaScript1.2">//editor_generate('Texto');</SCRIPT></P>
  <P> </P>
</FORM>
</DIV>
</BODY>


</HTML>
//-------------------------------------------------------------------------//

Je n'ai fait que migrer le code de ASP a PHP et 2 petites retouches pour corriger les erreurs.

Voila, bonne continuation.

signaler à un administrateur
Commentaire de fly261 le 10/06/2004 15:02:28

Bonjour,
Quand j'ai vu ce script, je l'ai trouvé excellent, mais je suis dit qu'il manquait quelques trucs. Notamment le fait qu'il soit en asp ou php

Je l'ai donc modifié, n'a besoin de rien d'autre que votre browser.
Recuperer les sources du script de chacal, puis coller ca dans un autre fichier. il manquera juste une image nommé deplacer.gif.

Voila, je remercie chacal pour son script, j'avais bosser sur un truc dans le genre, mais avec autant de fonctionalité.

Bon Allez a plus et encore merci

------------------------------------------------------------------------------


<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Microsoft FrontPage 5.0">
<META NAME="ProgId" CONTENT="FrontPage.Editor.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Nouvelle page 1</TITLE>

<script language="Javascript1.2">

var Objet;
var ObjetRes;
var DecX = 0;
var DecY = 0;
var PosX = 0;
var PosY = 0;
var Type = "";
var Angle = 0;
var actu;
var prec;
var demarre = "non";

/*var actu=document.all('Texte1');
var prec=document.all('Texte1');*/
var indexcpt=100;

function Bouge(Obj)
{

actu=Obj;
aff(Obj);

Obj = document.getElementById("dep");
actu.style.display='none';

TransParent(actu.id,100,1,100);
actu.style.zIndex=indexcpt++;
Obj.style.zIndex=indexcpt++;
if (prec != null && prec != actu)
{
TransParent(prec.id,5,1,70);
}
if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
Objet = Obj;
if (Objet) {
Decal();
   document.onmousedown = OnDown;
//   document.onmouseup = Release;
   }
}

function bouger(Obj)
{

// S'il n'y a pas de deplacement en cours, on attrape la piece
if (demarre == "non")
{
Bouge(Obj);
}
// S'il y a un deplacmeent en cours, on pose la piece
if (demarre == "oui")
{
Objet = document.getElementById("dep");
Release();
}
}

function OnDown ()
{
var nom = "fr_" + Objet.id;
if (document.getElementById(nom))
document.getElementById(nom).style.display='none';

if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
if (Type == "MOVE") {
document.onmousemove = posit;
}
/*else if (Type == "RESIZE") {
document.onmousemove = defTaille;
}*/
//   document.onmouseup = Release;
}

function OnDownRes ()
{
var nom = "fr_" + ObjetRes.id;
if (document.getElementById(nom))
document.getElementById(nom).style.display='none';

if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
/* if (Type == "MOVE") {
document.onmousemove = posit;
} else */
if (Type == "RESIZE") {
document.onmousemove = defTaille;
}
   document.onmouseup = ReleaseRes;
}

function Decal() {
Type = "MOVE";
if (Objet) {
OldX = parseInt(Objet.style.left);
OldY = parseInt(Objet.style.top);
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
DecX = x - OldX;
DecY = y - OldY;
} else {
return -1;
}
}
function Release()
{
demarre = "non";
var nom = "fr_" + actu.id;
actu.style.display='';
if (document.getElementById(nom))
document.getElementById(nom).style.display='';


if (Type == "MOVE" && Objet)
{
actu.style.top =  Objet.style.top;
actu.style.left = Objet.style.left;
/* ObjetDep.style.width=parseInt(Objet.style.width)+15;
ObjetDep.style.height=parseInt(Objet.style.height)+42;*/
Objet.style.visibility='hidden';
}

Objet = 0;
prec=actu;

}
function ReleaseRes()
{

var nom = "fr_" + ObjetRes.id;
if (document.getElementById(nom))
document.getElementById(nom).style.display='';

if (Type == "RESIZE")
{
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
Wd = (PosX - x)*(-1);
He = (PosY - y)*(-1);
ResizeItFR(Wd,He);
}

ObjetRes = 0;
}

function posit(){
if (Objet) {
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
if ( x%5 == 0 ||  y%5 == 0 )
{
NewX = x - DecX;
NewY = y - DecY;
moveIt(NewX,NewY);
}
// window.status = Objet.id+"(X="+NewX+",Y="+NewY+")";
} else {
return -1;
}
}
function moveIt(x,y){
if (Objet) {
demarre = "oui";

Objet.style.top =  y;
Objet.style.left = x;
} else {
return -1;
}
}
function ChangeTaille(Obj)
{

if(navigator.appName.substring(0,3) == "Net"){
document.captureEvents(Event.MOUSEDOWN|Event.MOUSEMOVE|Event.MOUSEUP);
}
ObjetRes = Obj;
if (ObjetRes) {
RepereIt();
   document.onmousedown = OnDownRes;
   document.onmouseup = ReleaseRes;
   }
}
function RepereIt() {
Type = "RESIZE";

if (ObjetRes) {
PosX = parseInt(ObjetRes.style.left);
PosY = parseInt(ObjetRes.style.top);
}
}
function defTaille () {
if (ObjetRes) {
x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollTop;
y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollLeft;
Wd = (PosX - x)*(-1);
He = (PosY - y)*(-1);
ResizeIt(Wd,He);
} else {
return -1;
}
}
function ResizeIt(Wd,He) {
if (Wd > 30 && He > 40) {
ObjetRes.style.width=Wd;
ObjetRes.style.height=He;
}
}
function ResizeItFR(Wd,He)
{
var nom = "fr_" + ObjetRes.id;
if (Wd > 29 && He > 39) {
if (document.getElementById(nom))
{
document.getElementById(nom).width = Wd;
document.getElementById(nom).height = He;
}
}
}
function degToRad (angle) {
angle = (angle/ 180) * 3.142;
return angle;
}
function rotate(name, angle){
//convert angle into radians
     var rad = degToRad(angle);

     //calculate cos and sin of the angle
     costheta = Math.cos(rad);
     sintheta = Math.sin(rad);

     //create object reference
     var Target = document.getElementById(name);
     if(Target) {
         //apply the filter
         Target.style.filter = "progid:DXImageTransform.Microsoft.Matrix();";

         //set up the properties
         Target.filters.item("DXImageTransform.Microsoft.Matrix").SizingMethod = "auto expand";
         Target.filters.item("DXImageTransform.Microsoft.Matrix").FilterType = "bilinear";

        //apply the rotation matrix transformation
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M11 = costheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M12 = -sintheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M21 = sintheta;
         Target.filters.item("DXImageTransform.Microsoft.Matrix").M22 = costheta;
    }    
}
function TransParent(name,Begin,Type,End) {
var Target = document.getElementById(name);
if (Target) {
Target.style.filter="Alpha";
Target.filters.item("Alpha").opacity = Begin;
Target.filters.item("Alpha").FinishOpacity = End;
Target.filters.item("Alpha").Style = Type;
}
}
function MagicEffect(Name,Angle,Mir,Inv,Xray,Gray,Opac) {
var Target = document.getElementById(Name);
if (Target) {
Target.style.filter = "progid:DXImageTransform.Microsoft.BasicImage();";

Target.filters.item("DXImageTransform.Microsoft.BasicImage").Rotation = Angle;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Mirror = Mir;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Invert = Inv;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").XRay = Xray;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Grayscale = Gray;
Target.filters.item("DXImageTransform.Microsoft.BasicImage").Opacity = Opac;
}
}

function aff(obj)
{
var ObjetDep = document.getElementById("dep");
// var ObjetRef1 = document.getElementById("Texte2");
var nom = "fr_"+obj.id;
var ObjetRef3 = document.getElementById(nom);
var ObjetRef1 = obj;

ObjetDep.style.zIndex=indexcpt++;

/*alert(ObjetRef3.height);
alert(ObjetRef3.width);
*/

ObjetDep.style.top =  ObjetRef1.style.top;
ObjetDep.style.left = ObjetRef1.style.left;
if (ObjetRef3){
ObjetDep.style.width=parseInt(ObjetRef3.width)+15;
ObjetDep.style.height=parseInt(ObjetRef3.height)+42;}
ObjetDep.style.visibility='visible';
}

function creaff(lien,nom)
{
var chainediv ="";
if (!document.getElementById(nom))
{
newsrc = lien;
chainediv = chainediv + "<DIV  id=\""+nom+"\" style=\"z-index:10;position: absolute; top:200; Left: 200; width: 300; height: 200; \"  class=\"div1\" >";
chainediv = chainediv + " <TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" STYLE=\"border-collapse: collapse\" BORDERCOLOR=\"#111111\" WIDTH=\"100%\" Height=100% ID=\"AutoNumber1\">";
// chainediv = chainediv + " <TR onmouseover=\"this.style.cursor='move';\"  onmousedown=\"Target=document.all('"+nom+"');bouger(Target);\" >";
chainediv = chainediv + " <TR onmouseover=\"this.style.cursor='normal';\" onmousedown=\"Target=document.all('"+nom+"');Target.style.zIndex=indexcpt++;TransParent(Target.id,100,1,100)\" >";
chainediv = chainediv + "     <TD WIDTH=\"3\" height=3><IMG BORDER=\"0\" SRC=\"Pict/Cadre/TL.gif\" WIDTH=\"5\" HEIGHT=\"21\"></TD>";
chainediv = chainediv + "     <TD bgcolor=\"#ECE8D8\" BACKGROUND=\"Pict/Cadre/Top.gif\"><font size=2 face=verdana color=#FFFFFF><b>"+nom+"</b></font></TD>";
chainediv = chainediv + "     <TD WIDTH=\"3\" height=3><IMG BORDER=\"0\" SRC=\"Pict/Cadre/TR.gif\" WIDTH=\"4\" HEIGHT=\"21\"></TD>";
chainediv = chainediv + "   </TR>";
chainediv = chainediv + "   <TR>";
chainediv = chainediv + "     <TD bgcolor=#ECE8D8 BACKGROUND=\"Pict/Cadre/Left.gif\"></TD>";
chainediv = chainediv + "     <TD BGCOLOR=\"#FFFFFF\" valign=top>";
chainediv = chainediv + "<table><tr><td  valign=\"bottom\" >";
chainediv = chainediv + "<iframe name=\"fr_"+nom+"\" scrolling=\"Auto\" height=\"200\" width=\"300\"  marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" src=\""+newsrc+"\" >";
chainediv = chainediv + "</iframe>";
chainediv = chainediv + "</td></tr></table> ";
chainediv = chainediv + "     </TD>";
chainediv = chainediv + "     <TD bgcolor=#ECE8D8 BACKGROUND=\"Pict/Cadre/Right.gif\"></TD>";
chainediv = chainediv + "   </TR>";
chainediv = chainediv + "   <TR>";
chainediv = chainediv + "     <TD WIDTH=\"3\" height=3><IMG BORDER=\"0\" SRC=\"Pict/Cadre/BL.gif\" WIDTH=\"5\" HEIGHT=\"16\"></TD>";
chainediv = chainediv + "     <TD bgcolor=#ECE8D8 BACKGROUND=\"Pict/Cadre/Bottom.gif\"></TD>";
chainediv = chainediv + "     <TD WIDTH=\"3\" height=3><IMG BORDER=\"0\" SRC=\"Pict/Cadre/BR.gif\" WIDTH=\"4\" HEIGHT=\"16\"></TD>";
chainediv = chainediv + "   </TR>";
chainediv = chainediv + " </TABLE>";
chainediv = chainediv + " <div id=\"CloZTexte1\" onmouseover=\"this.style.cursor='hand'\" onclick=\"Target=document.all('"+nom+"');Target.style.display='none'; \" style=\"z-index: 11;position: absolute;top: 5;right: 7\"><img alt=\"Fermer...\" src=\"pict/cadre/cloz.gif\"></div>";
chainediv = chainediv + " <div id=\"ResiZTexte1\"  onmousedown=\"Target=document.all('"+nom+"');ChangeTaille(Target);\" onmouseup=\"ReleaseRes();\" style=\"z-index: 11;position: absolute;cursor:se-resize;Bottom: 4;right: 3; width:10;height : 10;\">";
chainediv = chainediv + " <table alt=\"Taille...\" border=0 cellpadding=0 cellspacing=0 width=10 height=10>";
chainediv = chainediv + " <tr><td background=\"pict/cadre/resiz.gif\" ></td></tr></table>";
chainediv = chainediv + " </div>  ";
chainediv = chainediv + " <div id=\"DeplacTexte1\"  onmousedown=\"Target=document.all('"+nom+"');bouger(Target);\"  style=\"z-index: 11;position: absolute;cursor:se-resize;Bottom: 0;left: 1; width:15; height:15;\">";
chainediv = chainediv + " <table alt=\"Taille...\" border=0 cellpadding=0 cellspacing=0 width=15 height=15>";
chainediv = chainediv + " <tr><td width=15 height=15 ><img src=\"pict/cadre/deplacer.gif\" width=18 ></td></tr></table>";
chainediv = chainediv + " </div>  ";
chainediv = chainediv + "</DIV>";

document.body.innerHTML =  document.body.innerHTML + " " + chainediv;
}
else
document.getElementById(nom).style.display='';

if (actu== null && prec== null)
{
actu=document.getElementById(nom);
prec=document.getElementById(nom);
}

}
function menu()
{
var Target=document.all('ChoixAngTexte1');
if (Target.style.display=='none')
Target.style.display='';
else
Target.style.display='none';
}
</script>
<link rel="STYLESHEET" type="text/css" href="feuille.css">

</HEAD>
<BODY >

<div id="dep" style="z-index:10;position: absolute; top:200; Left: 200; width: 50; height: 100; visibility:hidden" class="div2" onmousedown="Target=document.all('dep');bouger(Target);" >
<table width="100%" height="100%" border=1 bordercolor="#808080" bgcolor="#ffffff" bordercolordark="#000000" bordercolorlight="#ffff00">
<tr><td align="center" valign="middle"><font color="#B0ABA8">Déplacement en cours... </font></td></tr></table>
</div>

<div id="tout" style="position:absolute;Top:0;left:0;width:100%;height:100%;" onmousedown="if (actu) TransParent(actu.id,20,1,20); if (prec) TransParent(prec.id,20,1,20);"></div>
<a href="javascript:menu()">menu</a>

<div id="ChoixAngTexte1" style="position:absolute;Top:35;left:10;width:45;display:'none'" onmouseover="this.style.display='';" onmouseout="this.style.display='none';">
<table width=100% Bgcolor=#ECE9D8 style="border-width:1;border-style: solid;" bordercolor=#505050>
<tr>
<td onmouseover="this.style.cursor='hand';this.bgColor='#BCBBE6';" onmouseout="this.bgColor='#ECE9D8';" onclick="creaff('popup.html','c moi');"><font size=2>popup</font></td>
</tr>
<tr>
<td onmouseover="this.style.cursor='hand';this.bgColor='#BCBBE6';" onmouseout="this.bgColor='#ECE9D8';" onclick="creaff('popup176.htm','c pas moi');"><font size=2>popup176.htm</font></td>
</tr>
<tr>
<td onmouseover="this.style.cursor='hand';this.bgColor='#BCBBE6';" onmouseout="this.bgColor='#ECE9D8';" onclick="creaff('popup177.htm','merdasse');"><font size=2>popup177.htm</font></td>
</tr>
<tr>
<td onmouseover="this.style.cursor='hand';this.bgColor='#BCBBE6';" onmouseout="this.bgColor='#ECE9D8';" onclick="creaff('test.html','ca marche bien');"><font size=2>test.html</font></td>
</tr>
</table>
</div>
<br><br>


</BODY>

</HTML>

signaler à un administrateur
Commentaire de le_chacal le 10/06/2004 15:34:52

Et ben merci les gens pour tous ces commentaires sympatiques...et pour ces adaptations que j'aurais de toute façon pas eu le temps de faire...
j'ai quelques autres truc comme ca en stock mais je n'ai plus le temps a y consacrer pour les rendre exploitable...et puis c'est souvent lié à de l'ASP (comme l'organigramme dynamique que j'ai posé sur aspfr.com )...

Si vous voulez en savoir + envoyez moi un message j'y répondrais (enfin si  j'en recois pas des tonnes...)

Good coding !

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Novembre 2008
LMMJVSD
     12
3456789
10111213141516
17181920212223
24252627282930

Consulter la suite du CalendriCode



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel BAÏSE, Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même