scriptwelt.org das JavaScript Archiv

Navigation

Navigation Themenbereiche
Kontakt

eine Mail an ScriptWelt.org

Kontaktformular

Impressum
impressum

Grafik & Text JavaScript / Post-It Zettel für die Webseite

Das JavaScript erstellt eine Art Post-It für die Webseite. Die Position lässt sich einfach anpassen.
Autor: unbekannt

Reminder:

Hier haben wir den Text vom Post-It


in <head> einfügen

<style>
<!--
#postit
{
position:absolute;
width:200px;
padding:5px;
background-color:lightyellow;
border:1px solid black;
visibility:hidden;
z-index:100;
cursor:hand;
color:black }
-->
</style>

in <body> einfügen

<Div id=postit style="left: 550px; TOP: 125px">
<Div align=right><b><a href="javascript:closeit()">[Close It]</a></b></Div>
<b>Reminder:</b><br>
<p><FONT face=Arial size=2>Hier kommt der Text rein </FONT></p>
</Div>


<script type="text/javascript" language="javascript">
//Post-it only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause postit to display every time page is loaded
var once_per_browser=0

///No edit here///
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ns4)
crossobj=document.layers.postit
else if (ie4||ns6)
crossobj=ns6? document.getElementById("postit") : document.all.postit
function closeit(){
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
crossobj.visibility="hide"
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function showornot(){
if (get_cookie('postdisplay')==''){
showit()
document.cookie="postdisplay=yes"
}
}
function showit(){
if (ie4||ns6)
crossobj.style.visibility="visible"
else if (ns4)
crossobj.visibility="show"
}
if (once_per_browser)
showornot()
else
showit()

</SCRIPT>