• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

popup bei klick

Status
Für weitere Antworten geschlossen.

digga

Mitglied
hi... ich hab ne frage:
ich habe hier einen code um ein Popup zu öffnen:

Code:
<script type="text/javascript">
function pop(file)
{
helpwindow = window.open(file,"pophelp","f1,f2,f3");
helpwindow.focus();
return false;
}
</script> 
<a href="datei.html" target="_blank" onclick="return pop('datei.html');">
Popup
</a>
so das geht ja auch... ich kann da drauf klicken und das Popup öffnet sich...

aber wie mache ich es, dass sich wenn ich auf den link klicke ein Popup öffnet, dass eine bestimmte Größe hat, nach hinten ein wenig durchsichtig ist und nicht verschiebbar ist??

so sollte das in etwa aussehen:
1l41-1.jpg


kann mir da jemand helfen?
danke schonmal im Vorraus...
 
Zuletzt bearbeitet:
Werbung:
Werbung:
Da hätte dir google aber auch geholfen...
Hier ein Beispiel:
HTML:
<html>
  <head>
    <style>
      .parentDisable {
      z-index:999;
      width:100%;
      height:100%;
      display:none;
      position:absolute;
      top:0;
      left:0;
      background-color: #ccc;
      color: #aaa;
      opacity: .5;
      filter: alpha(opacity=50);  
      }
      #popup {
      width:200;
      height:100;
      position:absolute;
      top:0px;
      left:200px;
      color: #000;
      background-color: #fff;
      }
    </style>
    <script>
      function pop() {
        document.getElementById('mainDiv').style.display='block';
        return false
      }
      function hide() {
        document.getElementById('mainDiv').style.display='none';
        return false
      }
    </script>
  </head>
  <body>
    <div id="mainDiv" class="parentDisable">
      <table border="1" id="popup"><tr><td>   Please <a href="#" onClick="return hide()">click</a></td></tr></table>
    </div>

    <h1>Hello</h1>
    Place a DIV, first thing, on the main page.
    z-index:999; width:100%;
    height:100%; display:none; position:absolute; top:0; left:0;  
    If you feel like getting fancy, you could set the alpha transparency of the
    div to like 50 percent or something. Then when you open the other
    window, first show this div. You will have issues with select boxes
    and other buggy things, ... the easiest way to deal with them is to
    set them to display:none while the child window is open.
    <br><a href="#" onClick="return pop()">Popup</a>
  </body>
</html>
 
Status
Für weitere Antworten geschlossen.
Zurück
Oben