Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Webseite bei PopUp mit JavaScript ausblenden/disablen

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe mir eine Seite zusammengebastelt, auf der ein PopUp Fenster mit Hilfe eines Buttons erscheint.

Nun sollen alle Elemente im Hintergrundfenster ausgeblendet (disabled) werden und sobald das Popup

Fenster geschlossen wird, sollen diese wieder eingeblendet werden.

Es muß außerdem alles mit JavaScript realisiert werden.

Hier ein Beispiel aus meinem Quellcode:

--------------------------------------------------

Aufruf auf der Hauptseite:

<input name="Submit" type="submit" onClick="javascript:PageDisabled()" value="add">

Das JavaScript:

function PageDisabled () {

MM_openBrWindow('explorer.html','','width=575,height=300');

DisEna (6,0);

};

function DisEna (WERT, STATUS) {

switch(WERT) {

case 6:

document.getElementsByName("DisabledElements")[0].disabled = !STATUS;

break;

};

};

PopUp Fenster

<body onunload="javascript:DisEna (6,1)">

--------------------------------------------------

Das Ausblenden funktioniert, jedoch nicht das einblenden.

Ich dachte, das es evtl. an dem PopUp Fenster liegt, wenn ich bei dem "onunload"

ein Alert ausgebe funktioniet dieses.

Vermutlich funktioniert es nicht da die eigentliche Aktion in der Contentseite

ausgeführt werden soll, was der Funktionsaufruf in dem PopUp Fenster jedoch nicht

weiß.

Hat jemand eine Idee, wie ich das hin bekomme, das alle Elemente wieder aktiviert

werden, sobald das PopUp Fenster geschlossen wird?

Danke und Gruß

Slayer8

<a href='javascript: closePop()'>Fenster schließen</a>


function closePop() {

    var aDisabled = window.opener.getElementsByName("disabled") // oder this.opener?

 for ( var i = 0; i < aDisabled.length(); i++) {

     aDisabled[ i].style.visibility = 'block';

   }

   self.close();

}

ungetestet

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.