You are not logged in.

  • Login

1

Friday, July 27th 2007, 3:48pm

"popup" für kurze zeit?

Hallo,
gibt es mit js, ajax oder einer sonstigen sprache(ausser flash), eine möglichkeit, für eine kurze zeit(nen 10 sek. delay z.b.) eine grafik an einer bestimmten stelle anzuzeigen?

2

Friday, July 27th 2007, 4:43pm

Jop das gibt es :). Siehe Code

JavaScript Code

1
2
3
4
5
6
7
8
function action(d) {
	document.getElementById(d).style.display = "none";
}
 
function ShowContent(d) {
	document.getElementById(d).style.display = "block";
	start = setTimeout("action('"+d+"')", 2000);
}


Wenn die 2. Funktion ausgeführt wird, wird nach 2 Sekunden wieder die erste Funktion ausgeführt. FAZIT: Der Element wird für 2 Sekunden angezeigt.

Lies dir das mal durch:
http://www.easy-coding.de/div-automatisches-ausblenden-nach-3-sekunden-t3740.html

Da gibts ein komplexeres Beispiel, was ich selbst auch verwende.

3

Friday, July 27th 2007, 5:00pm

okay, dankeschön! werds nachher mal probieren!

4

Friday, July 27th 2007, 5:07pm

Oder so

javascript:


JavaScript Code

1
2
3
4
5
6
7
8
<script type="text/javascript">
<!--
window.setTimeout("hidethepicture()",5000);
function hidethepicture() {
	document.getElementById('picture').style.display = "none"
}
-->
</script>


Ausgabe:

HTML Code

1
<img id="picture" name="" src="" alt="" />


Sorry aber hab erst jetzt gesehen das die Frage beantwortet wurde! :wink:

Mit freundlichen Grüßen!

Similar threads

Social bookmarks