Blackhead77
New member
In diesen Code wird der Code zum Schließen eines geöffneten Popupfensters mit JQuery nicht ausgeführt.
Wieß nicht warum:
HTML:
Wieß nicht warum:
HTML:
jQuery(function($) {
var popup_zustand = false;
$(".popup_oeffnen").click(function() {
if(popup_zustand == false) {
$("#popup").fadeIn("normal");
$("#hintergrund").css("opacity", "0.7");
$("#hintergrund").fadeIn("normal");
popup_zustand = true;alert("Hallo");
}
return false;
});
$(".schliessen").click(function() {
if(popup_zustand == true) {
$("#popup").fadeOut("normal");
$("#hintergrund").fadeOut("normal");
popup_zustand = false;
}
});
});
HTML:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>So einfach macht man ein jQuery Popup</title>
<link type="text/css" rel="stylesheet" href="popup.css"/>
<script type="text/javascript" src="jQuery.js"></script>
<script type="text/javascript" src="popup.js"></script>
</head>
<body>
<a href="#" class="popup_oeffnen">Popup öffnen</a>
<div id="popup">
<div class="schliessen"></div>
<div id="popup_inhalt">
<p><h2>Bild erfolgreich veröffentlicht!</h2></p>
<p style="text-align:justify;">
<div style="text-align:center;"><img src="bild.jpg" alt="Cocktailparty" border="0"/><br/>
<div style="text-align:center;"><img src="Hacken-gruen.jpg" alt="bestätigt" width=100; height=100 border="0"/><br/>
</div>
</div>
<div id="hintergrund"></div>
</body>
</html>
Zuletzt bearbeitet von einem Moderator: