IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Calendrier problème de popup et de positionnement


Sujet :

JavaScript

  1. #1
    Membre régulier Avatar de 12_darte_12
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Février 2005
    Messages
    212
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Transports

    Informations forums :
    Inscription : Février 2005
    Messages : 212
    Points : 107
    Points
    107
    Par défaut Calendrier problème de popup et de positionnement
    Bonjour,

    Voila le code source javascript :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    /******************************
    * GnooCalendar 1.4
    * calendrier dynamique en javascript
    ******************************/
    function GnooCalendar(n, min, max)
    {
    	this.target= null;
    	this.name =  new String(n);
    	this.tag =  new String();
    	this.title =  new String("GnooCalendar");
    	this.date=new Date();
    	this.moving = new Boolean(false);
    	this.vis = new Boolean(false);
    	this.free = new Boolean(false);
    	this.curYear = new Number(this.date.getFullYear());
    	this.maxYear = new Number(this.curYear+max);
    	this.minYear = new Number(this.curYear-min);
    	this.curMonth= new Number(this.date.getMonth());
    /*
    * GnooCalendar.setFree(Boolean vis)
    * affiche ou non des jours feries
    */
    	this.setFree=function(vis)
    	{
    		this.free=vis;
    		if(this.vis==true)
    			this.show();
    		return;
    	}
    /*
    * GnooCalendar.IsDragable(Boolean drag)
    * active/desactive l'option drag&drop 
    */
    	this.isDragable=function(drag)
    	{
    		if(drag==true && !document.layers)
    		{
    			document.onmousemove=this.getMouse;
    			document.getElementById(this.div).root=this;
    			document.getElementById(this.div).onmousedown=this.startMove;
    			document.getElementById(this.div).onmouseup=this.endMove;
    		}
    		return;
    	}
    /*
    * GnooCalendar.startMove()
    * initialise le drag & drop
    */
    	this.startMove=function(evt)
    	{
    		var event;
    		var tmp;
    		if(this.root.vis!=true)
    			return;
    		if(document.all)
    		{
    			event = window.event;
    			tmp = event.srcElement;
    			if(!tmp.form)
    			{
    				this.root.fixX = tmp.offsetLeft+event.offsetX;
    				this.root.fixY = event.offsetY;
    				while(tmp.parentElement!=document.getElementById(this.root.div) && tmp.parentElement!=null )
    				{
    					this.root.fixX += tmp.parentElement.offsetLeft;
    					this.root.fixY += tmp.parentElement.offsetTop;
    					tmp = tmp.parentElement;
    				}
    				this.root.moving=true;
    				self.movingCalendar = this.root;
    			}
    		}
    		else
    		{
    			event = evt;
    			tmp = event.target;
    			if( !tmp.form && tmp.tagName!="SELECT" && tmp.tagName!="OPTION" && tmp.tagName!="scrollbar" )
    			{			
    				this.root.fixX = event.layerX;
    				this.root.fixY = event.layerY;
    				this.root.moving=true;
    				self.movingCalendar = this.root;
    			}
    		}
    		return evt;
    	}
    /*
    * GnooCalendar.endMove()
    * termine le drag & drop
    */
    	this.endMove=function()
    	{
    		if(self.movingCalendar!=null)
    		{
    			self.movingCalendar.moving=false;
    		}
    		return false;
    	}
    /*
    * GnooCalendar.getMouse(Event evt)
    * change la liste des jours feriés jours feries
    */
    	this.getMouse=function(evt)
    	{
     
    		var event;
    		if(document.all)
    		{
    			event = window.event;
    			var scrollObj = (document.documentElement) ? document.documentElement : document.body;
    			this.posX = self.event.clientX+scrollObj.scrollLeft;
    			this.posY = self.event.clientY+scrollObj.scrollTop;
    		}
    		else
    		{
    			event = evt;
    			this.posX = evt.pageX ;
    			this.posY = evt.pageY ;
    		}
    		if(self.movingCalendar!=null)
    		{
    			if(self.movingCalendar.moving==true && self.movingCalendar.vis==true )
    				self.movingCalendar.move(this.posY-self.movingCalendar.fixY, this.posX-self.movingCalendar.fixX);
    		}
    		return false;
    	}
    /*
    * GnooCalendar.move(Number x, Number y)
    * déplace le calendrier
    */
    	this.move=function(x, y)
    	{
    		if(!document.layers)
    		{
    			document.getElementById(this.div).style.top = x+"px";
    			document.getElementById(this.div).style.left = y+"px";
    		}
    		return false;
    	}
     
    /*
    * GnooCalendar.setFreeDay(Array fd)
    * change la liste des jours feriés jours feries
    */
    	this.setFreeDay=function(fd)
    	{
    		this.freeday.length=0;
    		for(var i=0; i<fd.length; i++)
    			this.freeday[i] = new String(fd[i]);
    		if(this.vis==true)
    			this.show();
    		return;
    	}
    /*
    * GnooCalendar.isFreeDay(d,m)
    * true si jour ferié
    */
    	this.isFreeDay=function(d,m)
    	{
    		var tmp = this.checkDate(d)+"/"+this.checkDate(parseInt(m)+1);
    		if(this.free==false)
    			return false;
    		for(var i=0; i<this.freeday.length; i++)
    			if( tmp == this.freeday[i])
    				return true;
    		return false;
    	}
    /*
    * GnooCalendar.setTitle(t)
    * change le titre du calendrier
    */
    	this.setTitle=function(t)
    	{
    		this.title = t;
    		if(this.vis==true)
    			this.show();
    		return;
    	}
    /*
    * GnooCalendar.mList()
    * retourne la liste des mois 
    */
    	this.mList=function()
    	{
    		var tmp = "<table border='0' cellpadding='0' cellspacing='0' class='Gtab'>";
     
    		tmp += "<tr><td align='center' colspan='2' class='Gname'>";
    		if(document.layers)
    		{
    			tmp += "<table width='100%'>";
    			tmp += "<tr>";
    			tmp += "<td class='Gname' align='center'>"+this.title+"</td>";
    			tmp += "<td><a href='javascript://' onclick='"+this.name+".hide();' class='Gname'>X</a></td>";
    			tmp += "</tr>";
    			tmp += "</table>";
    		}
    		else
    		{
    			tmp += "<span style='float:left; text-indent:20px;'>"+this.title+"</span>";
    			tmp += "<span style='float:right;'>";
    			tmp += "<a href='javascript://' onclick='"+this.name+".hide();' class='Gname'>X</a>";
    			tmp += "</span>";
    		}
    		tmp += "</td></tr>";
    		tmp += "<tr>";
    		tmp += "<td class='Gtxt'><select name='"+this.name+"month' class='Gtxt' ";
    		tmp += "onchange='"+this.name+".setMonth(this[this.selectedIndex].value)' >\n";
    		for(var i=0; i<this.month.length; i++)
    		{			
    			tmp += "<option value='"+i+"'";
    			if(this.curMonth==i)
    				tmp += " selected";
    			tmp += ">"+ this.month[i] +"</option>\n";
    		}
    		tmp += "</select></td><td class='Gtxt'>\n";
    		tmp += this.yList();
    		tmp += "</td></tr></table>";
    		tmp += this.dList();
    		return tmp;
    	}
    /*
    * GnooCalendar.yList()
    * retourne la liste des années 
    */
    	this.yList=function()
    	{
    		var tmp = "<select name='"+this.name+"year' class='Gtxt' ";
    		tmp += "onchange='"+this.name+".setYear(this[this.selectedIndex].value);' >\n";
    		for(var i=this.minYear; i<=this.maxYear; i+=1)
    		{
    			tmp += "<option value='"+i+"'";
    			if(this.curYear==i)
    				tmp += " selected";
    			tmp += ">"+ i +"</option>\n";
    		}
    		tmp += "</select>\n";
    		return tmp;
    	}
     
    	this.dayCell=function(d,n)
    	{
    		var tmp = new String("");
    		if(this.isFreeDay(d,this.curMonth))
    			tmp += "<td class='Gfree'";
    		else
    			tmp += "<td class='Gc"+n+"'";
    		if(!document.layers)
    		{
    			tmp += "title='"+this.checkDate(d)+" "+this.month[this.curMonth]+" "+this.curYear+"'";
    			tmp += " onmousedown='"+this.name+".getDate(\"";
    			tmp += this.checkDate(d)+"/";
    			tmp += this.checkDate(1+parseInt(this.curMonth))+"/";
    			tmp += this.curYear+"\"";
    			tmp += ");' ";
    			tmp += " onmouseover='this.className=this.className+\"on\";' ";
    			tmp += " onmouseout='this.className= this.className.substring(0,this.className.indexOf(\"on\"));'";
    		}
    		else
    			tmp += " width='22' height='16' ";
    		tmp += ">";
    		return tmp;
    	}
    /*
    * GnooCalendar.dList()
    * retourne le tableau des jours
    */
    	this.dList=function()
    	{
    		var cur=new Number(1);
    		var tmpDate = new Date();
    		var tmp = new String("<table border='0' cellpadding='0' cellspacing='0' class='Gtab'>");
    		tmpDate.setDate(cur);
    		tmpDate.setMonth(this.curMonth);
    		tmpDate.setFullYear(this.curYear);
    		tmp += "<tr>\n";
    		for(var i=1; i<this.day.length; i++)
    			tmp += "<td class='Gh"+i+"'>"+ this.day[i] +"</td>\n";
    		tmp += "<td class='Gh0'>"+ this.day[0] +"</td>\n";
    		tmp += "</tr>\n";
    		for(var j=0; j<6; j++)
    		{
    			tmp += "<tr>\n";
    			for(var i=1; i<this.day.length; i++)
    			{
    				tmpDate.setDate(cur);			
    				if( cur<=31 && i==tmpDate.getDay() && this.curMonth==tmpDate.getMonth())
    				{
    					tmp += this.dayCell(cur,i);
    					tmp += this.getLink(cur);
    					cur+=1;
    				}
    				else
    				{
    					tmp += "<td class='Gc"+i+"'";
    					tmp += ">&nbsp;";
    				}
    				tmp += "</td>\n";
    				tmpDate.setDate(cur);
    			}
    			if( cur==tmpDate.getDate() && this.curMonth==tmpDate.getMonth())
    			{
    				tmp += this.dayCell(cur,0);
    				tmp += this.getLink(cur);
    				cur+=1;
    			}
    			else
    			{
    				tmp += "<td class='Gc0'";
    				tmp += ">&nbsp;";
    			}
    			tmp += "</td>\n</tr>\n";
    		}
    		tmp += "</table>\n";
    		return tmp;
    	}
    /*
    * GnooCalendar.getLink(c)
    * retourne la balise d'un lien
    */
    	this.getLink = function(c)
    	{
    		var tmp = new String("");
    		if(document.layers)
    		{
    			tmp = "<a href='javascript://' ";
    			tmp += "onclick='"+this.name+".getDate(\"";
    			tmp += this.checkDate(c)+"/";
    			tmp += this.checkDate(1+parseInt(this.curMonth))+"/";
    			tmp += this.curYear+"\"";
    			tmp += ");' class='NSday'>"+(c)+"</a>";
    		}
    		else
    		{
    			tmp = (c);
    		}
    		return tmp;
    	}
    /*
    * GnooCalendar.setMonth( Integer m )
    * modifie le mois à afficher
    */
    	this.setMonth = function(m)
    	{
    		this.curMonth = m;
    		this.show();
    		return;
    	}
    /*
    * GnooCalendar.getYear( Integer y )
    * modifie l'année à afficher
    */
    	this.getYear = function (y)
    	{
    		if(document.layers)
    		{
    			for(var i=0; i<document.layers[this.div].document.forms[this.name+"_form"][this.name+"year"].length; i++)
    			{
    				if(document.layers[this.div].document.forms[this.name+"_form"][this.name+"year"][i].value==y)
    				{
    					document.layers[this.div].document.forms[this.name+"_form"][this.name+"year"].selectedIndex=i;
    					this.setYear(y);
    					return;
    				}
    			}
    		}
    		else
    		{
    			for(var i=0; i<document.forms[this.name+"_form"].elements[this.name+"year"].length; i++)
    			{
    				if(document.forms[this.name+"_form"].elements[this.name+"year"][i].value==y)
    				{
    					document.forms[this.name+"_form"].elements[this.name+"year"].selectedIndex=i;
    					this.setYear(y);
    					return;
    				}
    			}
    		}
    		return;
    	}
    /*
    * GnooCalendar.getMonth( Integer m )
    * modifie le mois à afficher
    */
    	this.getMonth = function (d)
    	{
    		if(document.layers)
    		{
    			for(var i=0; i<document.layers[this.div].document.forms[this.name+"_form"][this.name+"month"].length; i++)
    			{
    				if(document.layers[this.div].document.forms[this.name+"_form"][this.name+"month"][i].value==d)
    				{
    					document.layers[this.div].document.forms[this.name+"_form"][this.name+"month"].selectedIndex=i;
    					this.setMonth(d);
    					return;
    				}
    			}
    		}
    		else
    		{
    			for(var i=0; i<document.forms[this.name+"_form"].elements[this.name+"month"].length; i++)
    			{
    				if(document.forms[this.name+"_form"].elements[this.name+"month"][i].value==d)
    				{
    					document.forms[this.name+"_form"].elements[this.name+"month"].selectedIndex=i;
    					this.setMonth(d);
    					return;
    				}
    			}
    		}
    		return;
    	}
    /*
    * GnooCalendar.setYear( Integer y )
    * modifie l'année à afficher
    */
    	this.setYear = function (y)
    	{
    		this.curYear = y;
    		this.show();
    		return;
    	}
    /*
    * GnooCalendar.setTarget( Object obj )
    * change le champs cible d'affichage de la date
    * BUG OPERA!
    */
    	this.setTarget = function (obj)
    	{
    		this.target = obj;
    		return;
    	}
    /*
    * GnooCalendar.hide()
    * masque le calendrier
    */
    	this.hide = function()
    	{
    		if(document.layers)
    			document.layers[this.div].visibility='hide';
    		else
    		{
    			document.getElementById(this.div).style.visibility = 'hidden';
    			document.getElementById(this.div).style.display = 'none';
    		}
    		this.vis = false;
    		this.endMove();
    		return;
    	}
     
    /*
    * GnooCalendar.getDate()
    * retourne la date selectionnée dans le champs cible
    */
    	this.getDate = function(d)
    	{
    		if(this.target!=null)
    		{
    			this.target.value=d;	
    			this.hide();
    		}
    		return;
    	}
     
    /*
    * GnooCalendar.show()
    * affiche le calendrier
    */
    	this.show = function()
    	{
    		this.vis = true;
    		this.tag = "<form name='"+this.name+"_form' method='post'>\n";
    		this.tag += this.mList();
    		this.tag += "</form>\n";
    		if(document.layers)
    		{
    			with(document.layers[this.div])
    			{				
    				document.open("text/html");
    				document.write(this.tag);
    				document.close();
    				visibility='show';
    			}
    		}
    		else
    		{
    			document.getElementById(this.div).innerHTML = ""+this.tag;
    			document.getElementById(this.div).style.visibility = 'visible';
    			document.getElementById(this.div).style.display = 'block';
    		}
    		return;
    	}
    /*
    * GnooCalendar.init( String d )
    * initialise le Calendrier à la date actuelle
    * paramêtres : 
    * d : nom du calque d'affichage
    * obj : objet dont la propriété value va recevoir le String de la date
    */
    	this.init = function(d, obj)
    	{
    		this.div=d;
    		this.target = obj;
    		this.date=new Date();
    		this.date.setDate(1);		
    		this.curMonth = this.date.getMonth();
    		this.curYear = this.date.getFullYear();
    		if(!self.movingCalendar)
    			self.movingCalendar=null;
    		return;
    	}
    /*
    * GnooCalendar.checkDate( Integer d )
    * paramêtre : le jour d'une date
    */
    	this.checkDate = function(d)
    	{
    		if(parseInt(d)<=9)
    			return "0"+parseInt(d);
    		return parseInt(d);
    	}
    	return this;
    }
    /******************************/
    GnooCalendar.prototype.day = ["D", "L", "M", "M", "J", "V", "S" ];
    GnooCalendar.prototype.month = ["Janvier", 
    				"F&eacute;vrier", 
    				"Mars", 
    				"Avril", 
    				"Mai", 
    				"Juin", 
    				"Juillet", 
    				"Ao&ucirc;t", 
    				"Septembre", 
    				"Octobre", 
    				"Novembre", 
    				"D&eacute;cembre"];
    /* jours feriés français */
    GnooCalendar.prototype.freeday= ["01/01","01/05","08/05","14/07","15/08","01/11","11/11","25/12"];
    /******************************/
    Voila mon source php :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <html>
    	<head>
    		<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
    		<title>GnooCalendar 1.4</title>
     
    <!-- FICHIER DE STYLE DU CALENDRIER //-->
    <link rel='stylesheet' href='gnoocalendar.css' />
    <!-- FICHIER DE SCRIPT DU CALENDRIER //-->
    <script type="text/javascript" src="gnoocalendar.js"></script>
     
    	</head>
     
    <script type="text/javascript">
    <!--
    /******************************/
    self.defaultStatus = "GnooCalendar 1.4";
    /******************************/
    /* 
    * instanciation de l'objet
    */
    var CL = new GnooCalendar("CL", 20, 10 );
    var CL2 = new GnooCalendar("CL2", 20, 10 );
    /******************************/
    function init()
    {
    	CL.init("calend", document.forms["testform"].elements["testestformield1"]);
    	CL.isDragable(true);
     
    	CL2.init("calend2", document.forms["testform"].elements["testestformield2"]);
    	CL2.isDragable(true);
    }
    /******************************/
    //-->
    </script>
     
    <body onload="init();">
     
    <div id="calend" style="position: absolute; z-index: 99; border: solid 0px #000000;visibility: hidden;">&nbsp;</div>
    <div id="calend2" style="position: absolute; z-index: 99; border: solid 0px #000000;visibility: hidden;">&nbsp;</div>
     
    <form name='testform' method='get' action='' style='margin:0px;'>
     
    <table border='0' align="center">
    	<tr>
    		<td>date selectionnée : </td>
    		<td><input type='text' name='testestformield1' value='' readonly="" />
    	      <a title="Calendrier" onclick='CL.show(); CL.setTitle("Date de d&eacute;but"); CL.setFree(true);'><img src="b_calendar.png" width="16" height="16" border="0" /></a></td>
    	</tr>
    	<tr>
    		<td>autre date</td>
    		<td><input type='text' name='testestformield2' value='' readonly="" />
          <a title="Calendrier" onclick='CL2.show(); CL2.setTitle("Date de fin"); CL2.setFree(true);'><img src="b_calendar.png" width="16" height="16" border="0" /></a></td>
    	</tr>
    	<tr>
    		<td><input type='button' name='hide1' onclick='CL.hide();' value='Masquer le calendrier date de d&eacute;but' /></td>
    		<td><input type='button' name='hide2' onclick='CL2.hide();' value='Masquer le calendrier date de fin' /></td>
    	</tr>
    </table>
     
    </form>
     
     
     
     
    </body>
    </html>

    Je vous evite le fichier css.

    - Mon premier problème est que mon calendrier est toujour considérer comme un popup.
    - Le deuxieme, c'est que je voudrai qu'il s'ouvre au bout de ma souris, mais je n'y arrive pas.

  2. #2
    Membre régulier Avatar de 12_darte_12
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Février 2005
    Messages
    212
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Transports

    Informations forums :
    Inscription : Février 2005
    Messages : 212
    Points : 107
    Points
    107
    Par défaut
    Je précise que c'est un script recuperer sur le net et que tout fonctionne correctement déjà.

    Mais je voudrai juste eviter qu'il soit reconnu comme popup.

    Et j'aimerai qu'il s'ouvre ou se terouve mon pointeur de souris

  3. #3
    Membre régulier Avatar de 12_darte_12
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Février 2005
    Messages
    212
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Transports

    Informations forums :
    Inscription : Février 2005
    Messages : 212
    Points : 107
    Points
    107
    Par défaut
    J'ai récupéré ce bout de code pour voir la position du curseur. Mais je n'arrive pas a la combiner avec mon code.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    function position(e)
    	{
    	x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
    	y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
    	window.status = "Souris X:"+x+" / Y:"+y;
    	}
    if(navigator.appName.substring(0,3) == "Net")
    	document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = position;
    Je pense qu'il faut l'intégrer a ce niveau la de mon fichier :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
       this.show = function()
       {
          this.vis = true;
          this.tag = "<form name='"+this.name+"_form' method='post'>\n";
          this.tag += this.mList();
          this.tag += "</form>\n";
          if(document.layers)
          {
             with(document.layers[this.div])
             {            
                document.open("text/html");
                document.write(this.tag);
                document.close();
                visibility='show';
             }
          }
          else
          {
             document.getElementById(this.div).innerHTML = ""+this.tag;
             document.getElementById(this.div).style.visibility = 'visible';
             document.getElementById(this.div).style.display = 'block';
          }
          return;
       }

  4. #4
    Membre régulier Avatar de 12_darte_12
    Homme Profil pro
    Administrateur systèmes et réseaux
    Inscrit en
    Février 2005
    Messages
    212
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Administrateur systèmes et réseaux
    Secteur : Transports

    Informations forums :
    Inscription : Février 2005
    Messages : 212
    Points : 107
    Points
    107
    Par défaut
    Vraiment personne n'a d'idée? Je n'arrive plus a avancer du tout.

Discussions similaires

  1. [PopUP][iframe] problème maj popup à partir d'une iframe
    Par fanchic29 dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 31/03/2006, 17h34
  2. Problème menu popup
    Par ptitJP dans le forum MFC
    Réponses: 8
    Dernier message: 10/03/2006, 14h16
  3. Problème fermeture popup
    Par nicolb dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 25/02/2006, 08h53
  4. Fonction ASP: problème avec popup
    Par claralavraie dans le forum ASP
    Réponses: 6
    Dernier message: 07/02/2006, 10h31
  5. Problème Formulaire + popup + page PHP
    Par nesbla dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 25/02/2005, 00h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo