javascript window.open vraag

  • Onderwerp starter Onderwerp starter buick
  • Startdatum Startdatum
Status
Niet open voor verdere reacties.

buick

Terugkerende gebruiker
Lid geworden
6 sep 2001
Berichten
2.901
Besturingssysteem
Windows 10/11
Ik wil bij mijn site een popup laten verschijnen (geen reclame, maar het inschrijf formulier).

Nu heb ik een pagina gemaakt met de volgende code :
Code:
<html>
<SCRIPT LANGUAGE="javascript"><!--window.open("test.html", "Create a new account", "width=100,
height=100, left=0, top=0, menubar=no, status=no, location=no, toolbar=no, scrollbars=no, 
resizable=no");//--></script>
</html>

Alleen bij mij verschijnt er niets. Zelfs niet met de popupkiller uitgeschakeld.

Zie ik misschien iets over het hoofd ?
:)
 
Ja, en....
wanneer moet het verschijnen:
bij openen pagina
bij afsluiten pagina
na klikken op link?

:cool:
 
Liefst wanneer een link worst aangeklikt
 
Worst? ;) :8-0:

Hier, zoek maar uit.
POPUP

We've all seen popup windows before, sometimes called interstitials. But did you know
you can actually pre-position where the popup will occur on a page? The positioning of a
popup window is just as important as the window itself. With the help of a little coding,
you can target your popups to where you want it appear on your user's screen. Consider
the following example:

with a "Click Here" link

Notice how the window will popp in the middle? This is done with attributes in the Script
tag! Check out this code example:
<A HREF="javascript:void(0)" ONCLICK="window.open('http://www.YOURSITE.com','miniwin',
'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,
width=300,height=170,screenX=300,screenY=400,top=300,left=400')">Click Here</a>

Note that we use two sets of attributes to determine placement. "X" and "Y" coordinates
are for Netscape, while "top" and "left" are for Explorer.
----------
We kennen wel de gewone popup windows.
Maar deze kun je ook op de plaats zetten die je wenst.
De positie van een popup window is net zo belangrijk als het venster zelf.
Met een beetje opletten bij het coderen kun je het netjes voor elkaar krijgen.
Bekijk even het voorbeeld script hierna.
Dit venster komt in het midden tevoorschijn.
Dit gebeurt door atributen in de Script tag!

<center>
<A HREF="javascript:void(0)"
ONCLICK="open('2_wolven_bl.jpg','miniwin','toolbar=0,location=0,directories=0,status=0,
menubar=0,scrollbars=0,resizable=0,width=300,height=170,screenX=300,screenY=400,
top=300,left=400')">klik hier voor groot plaatje</a>

</center>

Let er even op om TWEE sets attributen te gebruiken voor de "X" en "Y" coordinaten.
ten behoeve van Netscape, terwijl "top" en "left" voor Explorer zijn.
En let op de code achter elkaar te zetten. Op EEN regel, anders krijg je een
foutmelding..
Dit aanpassen aan de afmetingen van je plaatje width=300,height=170

========= POP UP vol=====
Opening a basic 300x300 window
<A HREF="javascript:void(0)"
ONCLICK="open('sample.htm','miniwin','toolbar=1,location=1,directories=1,status=1,
menubar =1,scrollbars=1,resizable=1,width=300,height=300')">Open a Window</A>

=====nw TMF====
<A HREF="javascript:void(0)"
ONCLICK="open('ar_pop1.html','miniwin','toolbar=0,location=0,directories=0,status=0,
menubar=0,scrollbars=1,resizable=1,width=450,height=400')">Open een voorbeeld</A>
=====1 =POPUP Window
Opening the window with all features turned off
<A HREF="javascript:void(0)"
ONCLICK="open('sample2.htm','miniwin','toolbar=0,location=0,directories=0,status=0,menuba
r=0,scrollbars=0,resizable=0,width=450,height=350')">Voorbeeld</A>
==
======2===
<A HREF="javascript:void(0)"
ONCLICK="open('knar_index.html','miniwin','toolbar=0,location=0,directories=0,status=1,
menubar=0,scrollbars=1,resizable=1,width=650,height=400')">Voorbeeld</A>

=============CLOSE Button
Adding a "close window button"
The close window button is nice to offer the reader. It can be in the form of a button,
image, or a text link.
Button link:
<br> <center><form><input TYPE="button" VALUE="Sluit Venster"
onClick="window.close()"></form>
</center> <BR>
Text link: <a href="javascript:window.close()"><B>CLOSE WINDOW</B></a>
<BR>
Image link: <a href="javascript:window.close()"><IMG SRC="closeme.gif" BORDER=0
ALT="CLOSE ME"></a>
============

Let op:
al je codes op één lijn zetten. in je editor, anders krijg je een foutmelding.
Dus Word Wrap gebruiken.

:cool:

/// edit
java script als één woord wegzetten.
Op het forum wordt het gesplitst.
 
Hij is gelukt :)
Bedankt weer :)
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan