Transformer un pop en pop de sortie?

clemssouille Messages postés 5 Statut Membre -  
clemssouille Messages postés 5 Statut Membre -
Bonjour a tous,

Sur mon site internet je voudrais faire un questionnaire pop up qui s'ouvrirait 'lorsque l'on quitte le site.
J'ai bien trouver un code qui fonctionne mais il ne s'ouvre qu'a l'arrivée sur la page et non a la sortie.
J'ai essayer de changer onload="" en onUnload="", mais sans resultat!!!!
Je suppose que la solution est dans le code javascript, mais javascript nést pas mon fort...
Quelqu'un a t'il la solution?

cf: voici le code

<script language="JavaScript1.2">
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var PopupWin_bouncelimit
var direction="up"
var PopupWin_usedropin=0
function PopupMe(){
if (!dom&&!ie&&!ns4){
window.open("http://www.mapage.php", "", "scrollbars=1")}else{
PopupWin_bouncelimit=32 //(must be divisible by 8)
PopupWin_crossobj=(dom)?document.getElementById("PopupWin_dropin").style : ie? document.all.PopupWin_dropin : document.PopupWin_dropin
PopupWin_crossframe=(dom)?document.getElementById("PopupWin_cframe") : ie? document.all.PopupWin_cframe : document.PopupWin_cframe
PopupWin_crossframe.src="http://www.mapage.php"
if(PopupWin_usedropin){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
PopupWin_crossobj.top=scroll_top-250+calunits}
PopupWin_crossobj.visibility=(dom||ie)? "visible" : "show"
if(PopupWin_usedropin){
PopupWin_dropstart=setInterval("PopupWin_dropin()",50)}}}
function PopupWin_dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(PopupWin_crossobj.top)<100+scroll_top){
PopupWin_crossobj.top=parseInt(PopupWin_crossobj.top)+40+calunits
if (parseInt(PopupWin_crossobj.top)>100+scroll_top){PopupWin_crossobj.top=100+scroll_top}}else{
clearInterval(PopupWin_dropstart)
PopupWin_bouncestart=setInterval("PopupWin_bouncein()",50)}}
function PopupWin_bouncein(){
PopupWin_crossobj.top=parseInt(PopupWin_crossobj.top)-PopupWin_bouncelimit+calunits
if (PopupWin_bouncelimit<0)
PopupWin_bouncelimit+=8
PopupWin_bouncelimit=PopupWin_bouncelimit*-1
if (PopupWin_bouncelimit==0){
clearInterval(PopupWin_bouncestart)}}
function PopupWin_dismissbox(){
if (window.PopupWin_bouncestart) clearInterval(PopupWin_bouncestart)
PopupWin_crossframe.src=""
PopupWin_crossobj.visibility="hidden"}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
</script>

</head>

<body class="thrColElsHdr" onload="javascript:PopupMe()">

A voir également:

1 réponse

clemssouille Messages postés 5 Statut Membre
 
Bon en fait jai trouver un logiciel gratuit pour faire un popup de sortie "Wise popup", qui fonctionne tres bien.
Cependant il est impossible de faire le popup en DHTML pour onUnload avec ce logiciel, et donc mon questionnaire est bloquer par les anti popup.
Quelqu'un sait-il s'il est possible de faire un popup DHTML pour onUnload?
0