MySQL ver gevorderde |
|
binnenkort ga ik aan mijn site beginnen (Dennisvb + site = . ja, idd), het werd tijd, maar nu zit ik met een probleempje.
Ik wil een pmsysteem erin maken. Wanneer er een nieuwe pm is moet er een script in werking worden gesteld. Je krijgt dan een beschrijving van onder met "U heeft 2 nieuwe berichten", a la MSN Messenger.
Nu heb ik op leejoo.nl een script gevonden, maar die werkt niet naar mijn zin. Nu moet je over een link gaan, dan verschijnt de beschrijving, ga je van de link af, dan verdwijnt deze weer.
Ik wil dat je nergens over heen hoeft te gaan, maar dat de beschrijving meteen omhoogkomt. Ook moet het dus zo'n 4 seconden naar boven gaan, en dan automatisch weer naar beneden.
alvast bedankt.
<script language="JavaScript1.2">
var description=new Array()
description[0]='Deze tekst verwijst naar de 1e link'// verander hier de tekst van de linkverwijzing 1
description[1]='Deze tekst verwijst naar de 2e link'// etc.....
description[2]='Deze tekst verwijst naar de 3e link'
description[3]='Deze tekst verwijst naar de 4e link'
iens6=document.all||document.getElementById
ns4=document.layers
var thename
var theobj
var thetext
var winHeight
var winPositionFromTop
var winWidth
var startH=2
var openTimer
function setObj(text,theswitch,inwidth,inheight) {
thetext=text
if(iens6){
thename = "viewer"
theobj=document.getElementById? document.getElementById(thename):document.all.thename
winHeight=100
if(iens6&&document.all) {
winPositionFromTop=document.body.clientHeight
winWidth=(document.body.clientWidth-document.body.leftMargin)}
if(iens6&&!document.all) {
winPositionFromTop=window.innerHeight
winWidth=(window.innerWidth-(document.body.offsetLeft+30)) }
if(theswitch=="override") {
winWidth=inwidth
winHeight=inheight}
theobj.style.width=winWidth
theobj.style.height=startH
if(iens6&&document.all) {
theobj.style.top=document.body.scrollTop+winPositionFromTop
theobj.innerHTML = ""
theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>")}
if(iens6&&!document.all) {
theobj.style.top=window.pageYOffset+winPositionFromTop
theobj.innerHTML = ""
theobj.innerHTML="<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>" }}
if(ns4){
thename = "nsviewer"
theobj = eval("document."+thename)
winPositionFromTop=window.innerHeight
winWidth=window.innerWidth
winHeight=100
if(theswitch=="override") {
winWidth=inwidth
winHeight=inheight}
theobj.moveTo(0,eval(window.pageYOffset+winPositionFromTop))
theobj.width=winWidth
theobj.clip.width=winWidth
theobj.document.write("<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>")
theobj.document.close()}
viewIt()}
function viewIt() {
if(startH<=winHeight) {
if(iens6) {
theobj.style.visibility="visible"
if(iens6&&document.all) {
theobj.style.top=(document.body.scrollTop+winPositionFromTop)-startH}
if(iens6&&!document.all) {
theobj.style.top=(window.pageYOffset+winPositionFromTop)-startH}
theobj.style.height=startH
startH+=2
openTimer=setTimeout("viewIt()",10)}
if(ns4) {
theobj.visibility = "visible"
theobj.moveTo(0,(eval(window.pageYOffset+winPositionFromTop)-startH))
theobj.height=startH
theobj.clip.height=(startH)
startH+=2
openTimer=setTimeout("viewIt()",10)}
}else{
clearTimeout(openTimer)}}
function stopIt() {
if(iens6) {
theobj.innerHTML = ""
theobj.style.visibility="hidden"
startH=2}
if(ns4) {
theobj.document.write("")
theobj.document.close()
theobj.visibility="hidden"
theobj.width=0
theobj.height=0
theobj.clip.width=0
theobj.clip.height=0
startH=2}}
</script>
<p align="center">
<!-- verander hieronder de url, de breedte en hoogte ( override) van de description, de target en de linknaam ! -->
<a href="http://www.javascript.nl/in.php?id=12" onmouseover="setObj(description[0],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link1</a>
<br><br>
<a href="http://www.kindophetweb.nl/cgi-bin/link/in.cgi?id=1042136565" onmouseover="setObj(description[1],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link2</a>
<br><br>
<a href="http://www.hello-world.nl/cgi-bin/links/in.cgi?id=1039971364" onmouseover="setObj(description[2],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link3</a>
<br><br>
<a href="http://www.janvis.nl" onmouseover="setObj(description[3],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link4</a> <script language="JavaScript1.2">
// verander hieronderde achtergrondkleur ( CCFFCC ) en de positie van de te verschijnen link beschrijving
if (iens6){
document.write("<div id='viewer' style='background-color:#CCFFCC;visibility:hidden;position:absolute;left:0;width:0;height:0;z-index:1;overflow:hidden;border:1px ridge white'></div>")}
if (ns4){
hideobj = eval("document.nsviewer")
hideobj.visibility="hidden"}
</script>
<script language="JavaScript1.2"> var description =new Array() description[0]='Deze tekst verwijst naar de 1e link'// verander hier de tekst van de linkverwijzing 1 description[1]='Deze tekst verwijst naar de 2e link'// etc..... description[2]='Deze tekst verwijst naar de 3e link' description[3]='Deze tekst verwijst naar de 4e link' iens6=document.all||document.getElementById ns4=document.layers var thename var theobj var thetext var winHeight var winPositionFromTop var winWidth var startH=2 var openTimer function setObj(text,theswitch,inwidth,inheight) { thetext=text if(iens6){ thename = "viewer" theobj=document.getElementById? document.getElementById(thename):document.all.thename winHeight=100 if(iens6&&document.all) { winPositionFromTop=document.body.clientHeight winWidth=(document.body.clientWidth-document.body.leftMargin)} if(iens6&&!document.all) { winPositionFromTop=window.innerHeight winWidth=(window.innerWidth-(document.body.offsetLeft+30)) } if(theswitch=="override") { winWidth=inwidth winHeight=inheight} theobj.style.width=winWidth theobj.style.height=startH if(iens6&&document.all) { theobj.style.top=document.body.scrollTop+winPositionFromTop theobj.innerHTML = "" theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>")} if(iens6&&!document.all) { theobj.style.top=window.pageYOffset+winPositionFromTop theobj.innerHTML = "" theobj.innerHTML="<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>" }} if(ns4){ thename = "nsviewer" theobj = eval("document."+thename ) winPositionFromTop=window.innerHeight winWidth=window.innerWidth winHeight=100 if(theswitch=="override") { winWidth=inwidth winHeight=inheight} theobj .moveTo (0,eval(window .pageYOffset +winPositionFromTop )) theobj.width=winWidth theobj.clip.width=winWidth theobj.document.write("<table cellspacing=0 width="+winWidth+" height="+winHeight+" border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>"+thetext+"</font></td></tr></table>") theobj.document.close()} viewIt()} function viewIt() { if(startH<=winHeight) { if(iens6) { theobj.style.visibility="visible" if(iens6&&document.all) { theobj.style.top=(document.body.scrollTop+winPositionFromTop)-startH} if(iens6&&!document.all) { theobj.style.top=(window.pageYOffset+winPositionFromTop)-startH} theobj.style.height=startH startH+=2 openTimer=setTimeout("viewIt()",10)} if(ns4) { theobj.visibility = "visible" theobj .moveTo (0,(eval(window .pageYOffset +winPositionFromTop )-startH )) theobj.height=startH theobj.clip.height=(startH) startH+=2 openTimer=setTimeout("viewIt()",10)} }else{ clearTimeout(openTimer)}} function stopIt() { if(iens6) { theobj.innerHTML = "" theobj.style.visibility="hidden" startH=2} if(ns4) { theobj.document.write("") theobj.document.close() theobj.visibility="hidden" theobj.width=0 theobj.height=0 theobj.clip.width=0 theobj.clip.height=0 startH=2}} </script> <p align="center"> <!-- verander hieronder de url, de breedte en hoogte ( override) van de description, de target en de linknaam ! --> <a href="http://www.javascript.nl/in.php?id=12" onmouseover="setObj(description[0],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link1</a> <br><br> <a href="http://www.kindophetweb.nl/cgi-bin/link/in.cgi?id=1042136565" onmouseover="setObj(description[1],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link2</a> <br><br> <a href="http://www.hello-world.nl/cgi-bin/links/in.cgi?id=1039971364" onmouseover="setObj(description[2],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link3</a> <br><br> <a href="http://www.janvis.nl" onmouseover="setObj(description[3],'override',300,40)" onmouseout="clearTimeout(openTimer);stopIt()" target="_blank">Link4</a> <script language="JavaScript1.2"> // verander hieronderde achtergrondkleur ( CCFFCC ) en de positie van de te verschijnen link beschrijving if (iens6){ document.write("<div id='viewer' style='background-color:#CCFFCC;visibility:hidden;position:absolute;left:0;width:0;height:0;z-index:1;overflow:hidden;border:1px ridge white'></div>")} if (ns4){ hideobj = eval("document.nsviewer")hideobj.visibility="hidden"} </script>
|