schau mal hier pino, ich hab da mal was vorbereitet
-grübel- also wenn ich weiter keine hilfe mehr bekomm, schaff ich das wohl doch noch allein -grins-
also, ich hab da mal einiges geändert jetzt, sieht auch schon ganz gut aus, aber irgendwie noch nich so ganz.
kurze erklärung: am anfang wird die fensterweite ermittelt, deswegen sollte das script auch zum ende der html ausgeführt werden. wenn es nu doch vorkommt, das keine fensterweite bestimmt werden konnte, so wird auch das menü nich angezeigt, da es sonst auf der linken seite dargestellt wird, wo es ja nich sein soll.
also, hier is der code
Code: Alles auswählen
if (window.innerWidth) {XOffset=window.innerWidth;} //NS
else if (document.body && document.body.offsetWidth) {XOffset=document.body.offsetWidth;} //IE
if (XOffset) {
YOffset = 20; // no quotes!!
staticYOffset = 20; // no quotes!!
slideSpeed = 20 // no quotes!!
waitTime = 1000; // no quotes!! this sets the time the menu stays out for after the mouse goes off it.
hdrFontFamily = "Verdana";
hdrFontSize = "3";
hdrFontColor = "white";
hdrBGColor = "#170088";
hdrAlign = "right";
hdrVAlign = "center";
hdrHeight = "20";
linkFontFamily = "Verdana";
linkFontSize = "2";
linkBGColor = "white";
linkOverBGColor = "#DDDDDD";
linkTarget = "_self";
linkAlign = "left"; //left
menuBGColor = "white";
menuIsStatic = "yes";
menuWidth = 200; // Must be a multiple of 10! no quotes!!
barBGColor = "#444444";
barFontFamily = "Verdana";
barFontSize = "2";
barFontColor = "white";
barVAlign = "top";
barWidth = 20; // no quotes!!
NS6 = (document.getElementById&&!document.all)
IE = (document.all)
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4")
moving=setTimeout('null',1)
function moveOut() {
if ((NS6 && parseInt(ssm.left)>XOffset-menuWidth)||(IE && ssm.style.pixelLeft>XOffset-menuWidth)||(NS && document.ssm.left>XOffset-menuWidth)) {
clearTimeout(moving);moving = setTimeout('moveOut()', slideSpeed)
if (NS6) {ssm.left = parseInt(ssm.left)-10+"px";}
if (IE) {ssm.style.pixelLeft -= 10;}
if (NS) {document.ssm.left -= 10;}}
else {clearTimeout(moving);moving=setTimeout('null',1)}};
function moveBack() {
clearTimeout(moving);moving = setTimeout('moveBack1()', waitTime)}
function moveBack1() {
if ((NS6 && parseInt(ssm.left)<XOffset)||(IE && ssm.style.pixelLeft<XOffset)||(NS && document.ssm.left<XOffset)) {
clearTimeout(moving);moving = setTimeout('moveBack1()', slideSpeed);
if (NS6) {ssm.left = parseInt(ssm.left)+10+"px";}
if (IE) {ssm.style.pixelLeft += 10;}
if (NS) {document.ssm.left += 10;}}
else {clearTimeout(moving);moving=setTimeout('null',1)}};
lastY = 0;
function makeStatic() {
if (NS6) {winY = window.pageYOffset;}
if (IE) {winY = document.body.scrollTop;var NM=document.all('ssm').style}
if (NS) {winY = window.pageYOffset;var NM=document.ssm}
if (NS6||IE||NS) {
if (winY!=lastY&&winY>YOffset-staticYOffset) {
smooth = .2 * (winY - lastY - YOffset + staticYOffset);}
else if (YOffset-staticYOffset+lastY>YOffset-staticYOffset) {
smooth = .2 * (winY - lastY);}
else {smooth=0}
if(smooth > 0) smooth = Math.ceil(smooth);
else smooth = Math.floor(smooth);
if (NS6) ssm.top=parseInt(ssm.top)+smooth+"px"
if (IE) NM.pixelTop+=smooth;
if (NS) NM.top+=smooth;
lastY = lastY+smooth;
setTimeout('makeStatic()', 1)}}
function initSlide() {
if (NS6){
ssm=document.getElementById("ssm").style
ssm.visibility="visible";
ssm.left = -menuWidth+XOffset;}
else if (IE) {
ssm.style.visibility = "visible"
ssm.style.pixelLeft = -menuWidth+XOffset;}
else if (NS) {
document.ssm.left = -menuWidth+XOffset;
document.ssm.visibility = "show"}
if (menuIsStatic=="no") makeStatic();}
function startMenu(menuHeader, barText) {
if (IE||NS6) {document.write('<DIV ID="ssm" style="visibility:hidden;Position : Absolute ;Left : '+XOffset+'px ;Top : '+YOffset+' ;Z-Index : 20;width:1px" onmouseover="moveOut()" onmouseout="moveBack()">')}
if (NS) {document.write('<LAYER visibility="hide" top="'+YOffset+'" name="ssm" bgcolor="'+menuBGColor+'" left="1000" onmouseover="moveOut()" onmouseout="moveBack()">')}
if (NS6){document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+(menuWidth+barWidth+2)+'" bgcolor="'+menuBGColor+'"><TR><TD>')}
tempBar=""
for (i=0;i<barText.length;i++) {
tempBar+=barText.substring(i, i+1)+"<BR>"}
document.write('<table border="0" cellpadding="0" cellspacing="1" width="'+(menuWidth+barWidth+2)+'" bgcolor="'+menuBGColor+'"><tr><td align="center" rowspan="100" width="'+barWidth+'" bgcolor="'+barBGColor+'" valign="'+barVAlign+'"><p align="center"><font face="'+barFontFamily+'" Size="'+barFontSize+'" COLOR="'+barFontColor+'"><B>'+tempBar+'</B></font></p></TD><td bgcolor="'+hdrBGColor+'" WIDTH="'+(menuWidth-1)+'" HEIGHT="'+hdrHeight+'" ALIGN="'+hdrAlign+'" VALIGN="'+hdrVAlign+'"> <font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+menuHeader+'</b></font></td></tr>')}
function addItem(text, link, target) {
if (!target) {target=linkTarget}
document.write('<TR><TD BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="'+(menuWidth-1)+'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%" ALIGN="'+linkAlign+'"><DIV ALIGN="'+linkAlign+'"><FONT face="'+linkFontFamily+'" Size="'+linkFontSize+'"> <A HREF="'+link+'" CLASS="ssmItems" target="_self">'+text+'</DIV></LAYER></ILAYER></TD></TR>')}
function addExItem(text, link, target) {
if (!target) {target=linkTarget}
document.write('<TR><TD BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="'+(menuWidth-1)+'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%" ALIGN="'+linkAlign+'"><DIV ALIGN="'+linkAlign+'"><FONT face="'+linkFontFamily+'" Size="'+linkFontSize+'"> <A HREF="'+link+'" target="_self" CLASS="ssmItems">'+text+'</DIV></LAYER></ILAYER></TD></TR>')}
function addExPic(text, link, target) {
if (!target) {target=linkTarget}
document.write('<TR><TD cellpadding="2" BGCOLOR="'+linkBGColor+'" onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="'+(menuWidth-1)+'"><ILAYER><LAYER onmouseover="bgColor=\''+linkOverBGColor+'\'" onmouseout="bgColor=\''+linkBGColor+'\'" WIDTH="100%" ALIGN="'+linkAlign+'"><DIV ALIGN="'+linkAlign+'"> <A HREF="'+link+'" target="_self" CLASS="ssmItems"><img src="'+text+'" border="0"></A></DIV></LAYER></ILAYER></TD></TR>')}
function addHdr(text) {
document.write('<tr><td bgcolor="'+hdrBGColor+'" HEIGHT="'+hdrHeight+'" ALIGN="'+hdrAlign+'" VALIGN="'+hdrVAlign+'" WIDTH="'+(menuWidth-1)+'"> <font face="'+hdrFontFamily+'" Size="'+hdrFontSize+'" COLOR="'+hdrFontColor+'"><b>'+text+'</b></font></td></tr>')}
function endMenu() {
document.write('<tr><td bgcolor="'+hdrBGColor+'"><font size="0" face="Arial"> </font></td></TR></table>')
if (NS6){document.write('</TD></TR></TABLE>')}
if (IE||NS6) {document.write('</DIV>')}
if (NS) {document.write('</LAYER>')}
if (NS6||IE||NS) setTimeout('initSlide();', 100)}
}
so, wer es nu ausprobiert wird sehn das das noch nich so ganz das ware is.
das erste is, das das menü nich wirklich ausgeblendet wird, sondern nur weiter nach rechts verschiebt, die ganzen links sind immernoch sichtbar, sobald ich da mal nach rechts scrolle.
und zweites kann ich nur ein menü maximal starten, wenn ich beide versuch, also links und rechts, dann kommt nix, wahrscheinlich gibs da interne fehler, weil beide menüs noch die selben variablen benutzen, aber sicher bin ich mir da noch nich.
wozu der ganze zauber? alsooo. ich möcht ganz gern auf meiner seite eine shortbox bzw chat haben, und die soll dann von jeder seite aus direkt erreichbar sein. das menü wird dann noch entsprechen umgebaut und mit einen iframe bestückt, so das das ganze dann alles zueinander passt.
so, und jetzt möcht ich doch bitte bitte etwas hilfe haben
