Hej Allan og andre
jeg har ikke de tilstrækkelige Javascript-kundskaber til at jeg kan
gennemskue hvad, der kan/skal bruges af denne kode, for at jeg - og andre
interesserede - kan anvende funktionen med popdown-vinduet med flere links.
Her er den fulde kode fra Dating.dk, men hvad der skal tages ud og hvordan
det skal laves om for at andre kan få denne funktion til at virke på et
link, kan jeg ikke gennemskue.
Derfor skriver jeg her, for at få hjælp fra mennesker, der er klogere end
jeg selv.
v.h.
Jakob Munck
------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)
http://www.dating.dk/Chat/ny/names.asp -->
<HTML><HEAD><TITLE>Chat Page</TITLE>
<META content="text/html; charset=windows-1252"
http-equiv=Content-Type><LINK
href="names-filer/chattyle.css" rel=stylesheet>
<STYLE>SELECT {
FONT-WEIGHT: 700
}
</STYLE>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR></HEAD>
<BODY oncontextmenu="return false;" ondrag="return false"
onload=window.parent.sync(4); onmouseup=hidePopup();
onselectstart=window.event.returnValue=false; style="MARGIN: 0px 0px 130px
5px"
;>
<SCRIPT language=javascript>
fMenuColor = '800000';
fMenuColor_h = '903030';
mMenuColor ='000080';
mMenuColor_h = '303090';
currentGlow = mMenuColor;
currentBG = mMenuColor;
var showFor = '';
var showForID = '';
function handleClick() {
lmnt = window.event.srcElement;
if (lmnt.tagName == 'IMG' || lmnt.tagName == 'SPAN') {
lmnt = lmnt.parentElement;
}
if (lmnt.tagName != 'DIV')
return;
showFor = lmnt.fullname;
showForID = lmnt.id.substr(4);
so = document.all.item('usermenu').style;
so.top = lmnt.offsetTop+11;
if (lmnt.className == 'male') {
currentGlow = mMenuColor_h;
currentBG = mMenuColor;
}
else {
currentGlow = fMenuColor_h;
currentBG = fMenuColor;
}
file://alert('a');
if (lmnt.userlevel <5) {
document.all['ignore'].style.display = '';
if (lmnt.style.textDecoration == 'line-through') {
document.all['ignore'].innerHTML = 'Stop filter';
}
else {
document.all['ignore'].innerHTML = 'Start filter';
}
}
else {
document.all['ignore'].style.display = 'none';
}
so.background = currentBG;
// document.all.item('usermenu').filters.blendtrans.apply();
so.visibility = 'visible';
// document.all.item('usermenu').filters.blendtrans.play(0.3);
}
function hidePopup(){
if (showFor != '' && window.event != null) {
window.event.cancelBubble = true;
file://document.all.item('usermenu').filters.blendtrans.apply();
document.all.item('usermenu').style.top = 100;
document.all.item('usermenu').style.visibility = 'hidden';
document.all.item('container').style.background =
document.all.item('container').style.background; file://workaround for IE
bug
file://document.all.item('usermenu').filters.blendtrans.play(0.2);
showFor = '';
showForID = '';
}
}
function hidePopup2(){
switch (event.srcElement.innerHTML) {
case 'Se profil':
window.open("../../account/show.asp?readfrom=2&popup=true&recid=" +
showForID,
"Info","width=630,height=500,resizable=yes,status=yes,toolbar=no,menubar=no,
location=no,scrollbars=yes");
break;
case 'Tilføj favoritliste':
window.open("../../account/show.asp?readfrom=2&addtofav=true&popup=true&reci
d=" + showForID,
"Info","width=630,height=500,resizable=yes,status=yes,toolbar=no,menubar=no,
location=no,scrollbars=yes");
break;
case 'Skriv til...':
window.parent.client.sendPublicTo(showFor);
break;
case 'Skriv privat til...':
window.parent.client.sendPrivateTo(showFor, showForID);
break;
case 'Skriv brev':
window.open("../../Mail/WriteLetter.asp?RecID="+showForID+"&Reply=-1&popup=t
rue","WriteMail"+
Math.floor(Math.random()*1000),"width=615,height=445,resizable=yes,status=no
,toolbar=no,menubar=no,location=no");
break;
case 'Følg efter':
window.parent.frames['client'].setFollow(showFor, showForID);
break;
case 'Buzz':
window.parent.frames['client'].buzz(showFor, showForID);
break;
case 'Start filter':
window.parent.frames['client'].ignoreUser(showForID, showFor, true);
break;
case 'Stop filter':
window.parent.frames['client'].stopIgnoringUser(showForID, showFor);
break;
}
hidePopup();
}
function glow() {
if (event.srcElement.id != 'usermenu') {
event.srcElement.style.background = currentGlow;
}
}
function noglow() {
if (event.srcElement.id != 'usermenu')
event.srcElement.style.background = ''; // inherrits bgcolor from parent.
}
</SCRIPT>
<SPAN id=container onmousedown=handleClick(); onmouseup=hidePopup();
align="center"></SPAN>
<DIV id=usermenu onmouseout=noglow(); onmouseover=glow();
onmouseup=hidePopup2();
style="BACKGROUND: #000080; BORDER-BOTTOM: black 2px solid; BORDER-LEFT:
black 2px solid; BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid;
COLOR: #ffffff; CURSOR: hand; FILTER: blendtrans(duration:0.300);
FONT-WEIGHT: 700; LEFT: 12px; POSITION: absolute; VISIBILITY: hidden;
Z-INDEX: 1">
<DIV>Skriv til...</DIV>
<DIV id=priv>Skriv privat til...</DIV><SPAN id=profile>
<DIV>Se profil</DIV>
<DIV>Tilføj favoritliste</DIV>
<DIV>Skriv brev</DIV></SPAN>
<DIV>Følg efter</DIV>
<DIV>Buzz</DIV>
<DIV id=ignore>Start filter</DIV></DIV></BODY></HTML>
----------------------------------------------------------------------------
----------------