Also möchte ich dieses Popup nach 3 Sekunden verschwinden lassen. Ich habe versucht, die Verzögerung Abfrage, die die meisten empfehlen, aber ich muss etwas falsch machen, denn jedes Mal, wenn ich es in etwas hinzufügen glitchy beginnt mit anderen Teilen meiner Webseite passiert. Ich bin Anfänger, wenn es um Java geht.Wie mache ich mein Popup nach 3 Sekunden verschwinden?
<script>
$(document).ready(function(){
$("#thover").click(function(){
\t \t $(this).fadeOut();
$("#tpopup").fadeOut();
\t });
$("#tclose").click(function(){
\t \t $("#thover").fadeOut();
$("#tpopup").fadeOut();
\t });
});
\t </script>
<style type="text/css">
#thover{
position:fixed;
background:#000;
width:100%;
height:100%;
opacity: .6
}
#tpopup{
position:absolute;
width:600px;
height:280px;
background:#fff;
left:50%;
top:97%;
border-radius:5px;
padding:0px 0;
margin-left:-320px; /* width/2 + padding-left */
margin-top:-150px; /* height/2 + padding-top */
text-align:center;
box-shadow:0 0 10px 0 #000;
}
#tclose{
position:absolute;
background:black;
color:white;
right:-15px;
top:-15px;
border-radius:50%;
width:30px;
height:30px;
line-height:30px;
text-align:center;
font-size:8px;
font-weight:bold;
font-family:'Arial Black', Arial, sans-serif;
cursor:pointer;
box-shadow:0 0 10px 0 #000;
}</style>
<div id="thover">
\t </div>
<div id="tpopup">
\t <img src="" /><img alt="http://www.raffles-american-school.edu.my/usr/pagesub.aspx?pgid=62" src="/data/cms/images/boarding_pop_up_3(1).jpg" style="width: 600px; height: 280px;" />
\t <div id="tclose">
\t \t X</div>
</div>
Danke an alle! die zweite Lösung hat wunderbar funktioniert –