Vous n'êtes pas identifié.

Annonces

Les pages de ce Forum sont exploitables par les Navigateurs Mozilla, Fire Fox, Opera, Safari, Konqueror, Netscape, MSIE.
  • Index
  •  » Le Java
  •  » Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

#1 [↑] [↓]29/01/2008 10:51:13

davidin80
Privilégié
Default Avatar
Date d'inscription: 11/12/2006
Messages: 104

Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Bonjour wink

J'espère que cela farte pour vous.

Voilà, n'ayant pas trouvé mon bonheur, j'en appelle à vous.

Je souhaiterais trouver un script permettant à chaque clic droit de la souris d'afficher le menu "traditionnel" (Page Précèdente, Page Suivante, Actualiser...) et une fenêtre type popup qui s'ouvre parallèlement en fond.

Les 2 existent séparément mais une fois réuni cela ne va pas wacko

Si vous avez cela sous la main, je suis preneur whistling

MERCI

roll

++

David

Hors ligne

 

#2 [↑] [↓]29/01/2008 11:56:46

Crazy
Super Admin azimuté
Crazy
Lieu: Côte d'Azur - FRANCE
Date d'inscription: 10/04/2006
Messages: 5462
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Pour la fenêtre type Pop-up, je sais faire...
Un exemple :

Code :

<script LANGUAGE="JavaScript1.1">
<!--
function right(e)
{
 var msg = "TEXTE...";
i f (navigator.appName == 'Netscape' && e.which == 3)
 {
 alert(msg); 
 return false;
 }
 else
i f (navigator.appName == 'Microsoft Internet Explorer' && event.button==2)
 {
 alert(msg);
 return false;
 }
 return true;
}
document.onmousedown = right;
// -->
</script>

wink
Alain AKA Arma


Je suis Bon (avec un grand C) et Immortel... Jusqu'à preuve du contraire !
http://crazy.cigiema.fr/chocoku/ - http://crazy.cigiema.fr/sorcier_glouton/ - http://crazy.cigiema.fr/tiger-osmose/
http://crazy.cigiema.fr/msnbetter_thangoogle/ - http://crazy.cigiema.fr/black-hattitude/

I remember and I feel free! - I am the Killer of the Lambs!

Hors ligne

 

#3 [↑] [↓]29/01/2008 12:02:11

rikaix
Trolleur de 1ère Catégorie
rikaix
Lieu: Aix en Provence
Date d'inscription: 11/04/2006
Messages: 377

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

1) C'est pas valide !
2) c'est pas une fenêtre pop up, c'est une boite d'alerte...

--> Go back to school


C'est en faisant n'importe quoi, qu'on devient n'importe qui.
(source : R. Gaillard)

Hors ligne

 

#4 [↑] [↓]29/01/2008 12:21:39

Crazy
Super Admin azimuté
Crazy
Lieu: Côte d'Azur - FRANCE
Date d'inscription: 10/04/2006
Messages: 5462
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Exact !
J'avais fait une fenêtre Pop-Up...
Faut que je retrouve cela...
Voila :

Code :

<script language="javascript">
<!--
var color="<?php echo $bg_color; ?>";
var IE=document.all?true:false; 

if (!IE) {document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove=getMouseXY; 
var mousex=0; var mousey=0; var sdd=0; var sddn=0; var stl=0; var llink=0; var iwt_scrollleft=0; var iwt_scrolltop=0; 

document.write('<div id="thumbnaildiv" style="position: absolute; visibility: hidden; z-index: 9999; top: 0; left: 0; "></div>');

window.onload=function()
{
	var x=document.getElementsByTagName('a'); 
	for (var i=0; i<x.length; i++)
	{
		x[i].onmouseover=function()
		{
			if (!sdd && !document.cookie.match("iwt_disable")) {show_dd(this.getAttribute("href")); sdd=1;}
		}
		x[i].onmousemove=function()
		{
			if (!sdd && !document.cookie.match("iwt_disable")) {sdd=1; show_dd(this.getAttribute("href"));}
		}
		x[i].onmouseout=function() 
		{
			sdd=0; setTimeout("hide_dd(); ",500); 
		}
	}
}

function getMouseXY(e) 
{
	if (document.documentElement.scrollLeft) {iwt_scrollleft=document.documentElement.scrollLeft;} 
	else {iwt_scrollleft=document.body.scrollLeft;}
	
	if (document.documentElement.scrollTop) {iwt_scrolltop=document.documentElement.scrollTop;}
	else {iwt_scrolltop=document.body.scrollTop;}
	
	if (IE) {mousex=event.clientX+iwt_scrollleft; mousey=event.clientY + iwt_scrolltop;}
	else {mousex=e.pageX; mousey=e.pageY;}
	
	if (mousex<0) {mousex=0;}
	
	if (mousey<0) {mousey=0;}
}

function show_dd(link)
{
	var chkext=link.substr(0,4); 
	ddomain=document.location.href; ddomain=ddomain.replace("http://",""); ddomain=ddomain.replace("https://",""); ddomain=ddomain.replace("www.",""); 
	var ddomain=ddomain.split('/'); var ddomain=ddomain[0]; 
	ldomain=link; ldomain=ldomain.replace("http://",""); ldomain=ldomain.replace("https: //",""); 
	var ldomain=ldomain.split('/'); var ldomain=ldomain[0]; ldomainc=ldomain.replace("www.",""); 
	if (ldomainc && ddomain && chkext=="http" && !ldomainc.match(ddomain))
	{
		chg=1; 
		if (llink!==ddomain)
		{
			if (!color) {color="0066B9";} 
			document.getElementById('thumbnaildiv').innerHTML="<table width=\"150\" style=\"border-collapse: collapse; border: 1px solid #"+color+"; \" bgcolor=\"#ffffff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" onmouseover=\"sddn=1; \" onmouseout=\"sddn=0; setTimeout('hide_dd(); ',500); \"><tr><td style=\"padding: 1px 1px 1px 1px; \" bgcolor=\"#"+color+"\"><table cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; \" width=\"100%\"><tr><td height=\"18\" style=\"padding: 1px 1px 1px 1px; \"><font style=\"font-size: 7pt; font-family: verdana,tahoma,arial; color: #ffffff; font-weight: bold; \">&nbsp;Pr&eacute;visualisation</font></td><td style=\"padding: 1px 1px 1px 1px; \" align=\"right\"><font style=\"font-size: 7pt; color: #ffffff; font-weight: bold; font-family: verdana,tahoma,arial; \"><a href=\"#\" style=\"font-size: 7pt; text-decoration: underline; color: #ffffff; font-family: verdana,tahoma,arial; \" onclick=\"iwt_ds(); return false; \">d&eacute;sactiver</a>&nbsp;</font></td></tr></table></td></tr><tr><td style=\"padding: 1px 1px 1px 1px; \"><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; \"><tr><td align=\"center\" colspan=\"2\" height=\"95\" bgcolor=\"#F5F5F5\" style=\"padding: 1px 1px 1px 1px; background-repeat: no-repeat; background-position: center\" valign=\"middle\"><a href=\""+link+"\" target=\"_target\"><img border=\"0\" style=\"border: solid #ffffff 1px\" onmouseover=\"this.style.borderColor='#"+color+"'\" onmouseout=\"this.style.borderColor='#ffffff'\" alt=\"\" src=\"http://open.thumbshots.org/image.pxf?url="+encodeURIComponent(ldomain)+"\"></a></td></tr><tr><td align=\"center\" style=\"padding: 1px 1px 1px 1px; \"><div style=\"width: 135; overflow: hidden; \"><a href=\""+link+"\" target=\"_target\" onmouseover=\"this.style.textDecoration='underline'\" onmouseout=\"this.style.textDecoration='none'\" style=\"font-weight: bold; text-decoration: none; font-family: verdana,tahoma,arial; font-size: 8pt; color: #"+color+"; \">"+ldomainc+"</a></div></td><td style=\"padding: 1px 1px 1px 1px; \" align=\"center\"></td></tr></table></td></tr></table>"; llink=ldomain;
		}
		if (chg && !stl) {setTimeout("show_ddt(); ",700);}
		else
		{
			if (window.innerWidth) {var cwidth=window.innerWidth;}
			else if (document.documentElement.clientWidth) {var cwidth=document.documentElement.clientWidth;}
			else if (document.body.clientWidth) {var cwidth=document.body.clientWidth;}
			
			if (window.innerHeight) {var cheight=window.innerHeight;}
			else if (document.documentElement.clientHeight) {var cheight=document.documentElement.clientHeight;}
			else if (document.body.clientHeight) {var cheight=document.body.clientHeight;}
			
			if ((mousex+175)>cwidth) {mousex=mousex-150;}
			else {mousex=mousex+5;}
			
			if ((mousey+150)>cheight+iwt_scrolltop) {mousey=mousey-140;}
			else {mousey=mousey+5;}
			
			document.getElementById('thumbnaildiv').style.left=mousex+'px'; document.getElementById('thumbnaildiv').style.top=mousey+'px'; 
		}
	}
}

function hide_dd()
{
	if (!sdd && !sddn)
	{
		document.getElementById('thumbnaildiv').innerHTML=""; 
		document.getElementById('thumbnaildiv').style.visibility="hidden"; sdd=0; stl=0; 
	}
}

function show_ddt()
{
	document.getElementById('thumbnaildiv').style.visibility='visible'; stl=1; 
	if (window.innerWidth) {var cwidth=window.innerWidth;}
	else if (document.documentElement.clientWidth) {var cwidth=document.documentElement.clientWidth;}
	else if (document.body.clientWidth) {var cwidth=document.body.clientWidth;}
	if (window.innerHeight) {var cheight=window.innerHeight;}
	else if (document.documentElement.clientHeight) {var cheight=document.documentElement.clientHeight;}
	else if (document.body.clientHeight) {var cheight=document.body.clientHeight;}
	if ((mousex+175)>cwidth) {mousex=mousex-150;}
	else {mousex=mousex+5;}
	if ((mousey+150)>cheight+iwt_scrolltop) {mousey=mousey-140;}
	else {mousey=mousey+5;}
	document.getElementById('thumbnaildiv').style.left=mousex+'px'; document.getElementById('thumbnaildiv').style.top=mousey+'px'; 
}

function iwt_ds()
{
	if (confirm("Voulez-vous vraiment désactiver cette fonction ?")) {document.cookie="iwt_disable=1";}
}
// -->
</script>

Mais c'est très spécifique...
Cela risque d'être dur de le transformer !
big_smile
Alain AKA Arma


Je suis Bon (avec un grand C) et Immortel... Jusqu'à preuve du contraire !
http://crazy.cigiema.fr/chocoku/ - http://crazy.cigiema.fr/sorcier_glouton/ - http://crazy.cigiema.fr/tiger-osmose/
http://crazy.cigiema.fr/msnbetter_thangoogle/ - http://crazy.cigiema.fr/black-hattitude/

I remember and I feel free! - I am the Killer of the Lambs!

Hors ligne

 

#5 [↑] [↓]29/01/2008 14:38:38

serval2a
Pape de l'Internet
serval2a
Date d'inscription: 05/09/2006
Messages: 731
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Moi j'ai ça. ça marche si on clique 2 fois sur le bouton droit et c'est une base sans nul doute car une compilation de javascripts.

Code :

<SCRIPT LANGUAGE="JavaScript">
NS = navigator.appName=="Netscape"
IE = navigator.appName=="Microsoft Internet Explorer"
Ver = parseInt(navigator.appVersion)
message = "Clic Droit de Souris\n Non Autorisé";

document.onmousedown = NoClic; // Capture sous Netscape 6 et IE
if (document.layers) { // Capture sous Netscape 4.X
 window.captureEvents(Event.MOUSEDOWN);
 window.onmousedown = NoClic;
}

function NoClic(leclic) { // Affichage du message d'alerte
if (NS && leclic.which > 1){
window.open ('http://outils.enaty.com/outils/pop-up/url.php', 'nom_interne_de_la_fenetre', config='height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
} else if (IE && (event.button >1)) {
window.open ('http://outils.enaty.com/outils/pop-up/url.php', 'nom_interne_de_la_fenetre', config='height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}
}
</script>

Hors ligne

 

#6 [↑] [↓]29/01/2008 16:53:16

davidin80
Privilégié
Default Avatar
Date d'inscription: 11/12/2006
Messages: 104

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

serval2a a écrit :

Serval2a MERCI

Cela marche au poil sous IE 7
Je testerais ultérieurement sous FF

Seul bémol : comme il s'agit d'un popup IE 7 le bloque

On ne peut pas forcer un popup je crois ?

Hors ligne

 

#7 [↑] [↓]29/01/2008 17:10:30

Crazy
Super Admin azimuté
Crazy
Lieu: Côte d'Azur - FRANCE
Date d'inscription: 10/04/2006
Messages: 5462
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Tu n'as qu'à pas faire de Pop-Up, mais ouvrir une fenêtre !
Code (exemple) :

Code :

<img style="cursor:pointer;" alt="Cliquer pour agrandir (ouvre une fenêtre)" src="/images/miniatures/geisha.jpg" onClick="javascript:window.open('/images/Rainguez_-_Geisha_-_Huile_sur_toile_140x65_cm).jpg', 'image1', 'menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=1, left=1, width=370, height=760');">

wink
Alain AKA Arma


Je suis Bon (avec un grand C) et Immortel... Jusqu'à preuve du contraire !
http://crazy.cigiema.fr/chocoku/ - http://crazy.cigiema.fr/sorcier_glouton/ - http://crazy.cigiema.fr/tiger-osmose/
http://crazy.cigiema.fr/msnbetter_thangoogle/ - http://crazy.cigiema.fr/black-hattitude/

I remember and I feel free! - I am the Killer of the Lambs!

Hors ligne

 

#8 [↑] [↓]29/01/2008 17:23:08

davidin80
Privilégié
Default Avatar
Date d'inscription: 11/12/2006
Messages: 104

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Crazy a écrit :

Tu n'as qu'à pas faire de Pop-Up, mais ouvrir une fenêtre !
Code (exemple) :

Code :

<img style="cursor:pointer;" alt="Cliquer pour agrandir (ouvre une fenêtre)" src="/images/miniatures/geisha.jpg" onClick="javascript:window.open('/images/Rainguez_-_Geisha_-_Huile_sur_toile_140x65_cm).jpg', 'image1', 'menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, top=1, left=1, width=370, height=760');">

wink
Alain AKA Arma

Oui je me doutais un peu whistling
Mais comment faire sachant que cela doit s'ouvrir à partir d'un clic droit ? wacko

Hors ligne

 

#9 [↑] [↓]29/01/2008 17:32:33

Crazy
Super Admin azimuté
Crazy
Lieu: Côte d'Azur - FRANCE
Date d'inscription: 10/04/2006
Messages: 5462
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Change le "OnClick" Et ajoute ce qu'il manque...
wink
Alain AKA Arma


Je suis Bon (avec un grand C) et Immortel... Jusqu'à preuve du contraire !
http://crazy.cigiema.fr/chocoku/ - http://crazy.cigiema.fr/sorcier_glouton/ - http://crazy.cigiema.fr/tiger-osmose/
http://crazy.cigiema.fr/msnbetter_thangoogle/ - http://crazy.cigiema.fr/black-hattitude/

I remember and I feel free! - I am the Killer of the Lambs!

Hors ligne

 

#10 [↑] [↓]29/01/2008 18:47:41

serval2a
Pape de l'Internet
serval2a
Date d'inscription: 05/09/2006
Messages: 731
Site web

Re: Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Deuxième essai :

Code :

<html>
<head>
</head>
<body>
<script language="javascript">
<!--
function droite(e)
	{
	if ((!document.all && e.which == 3) || (document.all && event.button==2))
		{
		window.open ('http://outils.enaty.com/outils/pop-up/url.php', 'nom_interne_de_la_fenetre', config='height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');
		}
	return true;
}
document.onmousedown = droite;
// -->
</script>
</body>
</html>

Le résultat est différent sur IE et FF mais on arrive presque à ce que tu veux.


Hors ligne

 
  • Index
  •  » Le Java
  •  » Clic Droit : avoir le menu "traditionnel" et une fenêtre qui s'ouvre

Pied de page des forums

Powered by PunBB modified
© Copyright 2002–2005, Rickard Andersson
© Interface & Functional Add-ons Copyright 2006-2007, by Crazy


RSS Forum CIGIEMA

© 2006-2010 / A. G.
CiGi€M@®, 1997-2010
IDDN Reproduction totale ou partielle strictement interdite
Contact :
/