Tilretning af mindre script
Jeg sidder her og er igang med at opbygge den nye LJWeb GmbH site og er stødt på lidt problemer. Problemer jeg oftest selv ville kunne klare, men al min dokumentation, bøger o.lign. er i en container og er \"not/available\" *g* Det ser ud til at selv et 11\'tal i JS kodning ikke er nok til at have det hele på ryggraden *g*Nå, men problemet ligger i at jeg ikke kan få min scroller til at virke i Netscape v4 browsere. Jeg har ikke adgang til de fleste af mine maskiner så jeg har \"kun\" testet med IE5.5 og NN4.72... Jeg vil meget gerne have testet og fået kode til at virke i NN4.08 og gerne også 6.01...
Jeg ligger en større pulje point i som gulerod og håber på en gider assistere en udvikler der nærmest er bundet på hænder og fødder.
PS. Jeg er ikke begyndt at \"pynte\" kode og skrive det pænt. Hvordan der implementeres er underordnet, jeg går igennem koder og renskriver.
PPS. Jeg vil prøve at kigge til spørgsmålet men mine sidste dage i DK er lidt hektiske.... Der kan gå op til en uge før jeg vender tilbage... :( ved et svar, plz. send mig en kort mail notitz på ljweb@ljweb.com
PUPS. Er der nogen der kender en god crossbrowser pulldown menu der kan lege med transperency og virke i ovenstående browsere ? altså v4+ ?
/ LJWeb
Selve html filen i sin helhed :
<HTML>
<HEAD>
<TITLE>LJWeb GmbH : Internet Programming and Consultancy ...</TITLE>
<LINK REL=\"stylesheet\" HREF=\"css/menucss.css\">
<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"js/scroll_engine.js\" TYPE=\"text/javascript\"></SCRIPT>
<SCRIPT LANGUAGE=\"JavaScript\">
<!--
function nsResize() {
location.reload();
}
window.onresize = nsResize;
if (document.layers) {
winW = window.innerWidth;
var mainTable = \'<TABLE WIDTH=\"\'+winW+\'\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\';
} else {
var mainTable = \'<TABLE ALIGN=\"right\" WIDTH=\"100%\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\">\';
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=\"JavaScript\">
<!--
var ns4 = (document.layers)?true:false;
var ie4 = (document.all)?true:false;
var dom = (document.getElementById)?true:false;
function yPos(what){
var picY = (ns4)?document.images[what].y:getY(document.images[what]);
return picY;
}
function xPos(what){
var picX = (ns4) ? document.images[what].x : getX(document.images[what]);
return picX;
}
function getY(obj) {
if (obj == document.body) {
return obj.offsetTop
}
return obj.offsetTop + getY(obj.offsetParent);
}
function getX(obj) {
if (obj == document.body) {
return obj.offsetLeft
}
return obj.offsetLeft + getX(obj.offsetParent);
}
function dropMenu() {
var i,p,v,obj,args = dropMenu.arguments;
if(document.getElementById) {
for (i=0; i<(args.length-2); i+=3) {
obj=tmt_findObj(args[i]);v=args[i+2];
v=(v==\'show\')?\'visible\':(v=\'hide\')?\'hidden\':v;
if(obj) obj.style.visibility=v;
}
} else {
for (i=0; i<(args.length-2); i+=3) {
if ((obj=MM_findObj(args[i]))!=null) {
v=args[i+2];
if (obj.style) {
obj=obj.style;
v=(v==\'show\')?\'visible\':(v=\'hide\')?\'hidden\':v;
}
obj.visibility=v;
}
}
}
}
function jsInit() {
InitializeScrollableArea()
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=\"#344156\" LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" onLoad=\"jsInit();\">
<SCRIPT LANGUAGE=\"JavaScript\">document.write(mainTable);</SCRIPT>
<TR>
<TD HEIGHT=\"91\" BACKGROUND=\"pics/top.gif\"><IMG SRC=\"pics/menu/space.gif\" WIDTH=\"1\" HEIGHT=\"91\" ALT=\"\" BORDER=\"0\"></TD>
</TR>
<TR>
<TD HEIGHT=\"18\" BACKGROUND=\"pics/flag_bg.jpg\" ALIGN=\"left\" VALIGN=\"middle\">
<IMG SRC=\"pics/menu/space.gif\" WIDTH=\"1\" HEIGHT=\"1\" ALT=\"\" BORDER=\"0\">
<IMG SRC=\"pics/dk_flag.gif\" WIDTH=\"17\" HEIGHT=\"9\" BORDER=\"0\" ALT=\"Dansk\">
<IMG SRC=\"pics/us_flag.gif\" WIDTH=\"17\" HEIGHT=\"9\" BORDER=\"0\" ALT=\"English\">
<IMG SRC=\"pics/mex_flag.gif\" WIDTH=\"17\" HEIGHT=\"9\" BORDER=\"0\" ALT=\"Espa&#ntilde;ol\">
<IMG SRC=\"pics/jpn_flag.gif\" WIDTH=\"17\" HEIGHT=\"9\" BORDER=\"0\" ALT=\"Nihongo\">
</TD>
</TR>
<TR>
<TD HEIGHT=\"22\" BACKGROUND=\"pics/menu_bg.gif\" VALING=\"bottom\" ALIGN=\"right\">
<IMG SRC=\"pics/menu/news.gif\" BORDER=\"0\" NAME=\"menuNews\" ALT=\"\" WIDTH=\"29\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
<IMG SRC=\"pics/menu/profile.gif\" BORDER=\"0\" NAME=\"menuProfile\" ALT=\"\" WIDTH=\"52\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
<IMG SRC=\"pics/menu/qualifications.gif\" BORDER=\"0\" NAME=\"menuQualifications\" ALT=\"\" WIDTH=\"105\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
<IMG SRC=\"pics/menu/portfolio.gif\" BORDER=\"0\" NAME=\"menuPortfolio\" ALT=\"\" WIDTH=\"67\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
<IMG SRC=\"pics/menu/library.gif\" BORDER=\"0\" NAME=\"menuLibrary\" ALT=\"\" WIDTH=\"90\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
<IMG SRC=\"pics/menu/contact.gif\" BORDER=\"0\" NAME=\"menuContact\" ALT=\"\" WIDTH=\"53\" HEIGHT=\"6\">
<IMG SRC=\"pics/menu/space.gif\">
</TD>
</TR>
<TR>
<TD HEIGHT=\"250\" BACKGROUND=\"pics/main.jpg\" ALIGN=\"right\" VALIGN=\"bottom\"></TD>
</TR>
<TR>
<TD ALIGN=\"right\" VALIGN=\"bottom\"><DIV CLASS=\"copy\"><B>All Rights Reserved, LJWeb GmbH</B> </DIV></TD>
</TR>
</TABLE>
<DIV ID=\"scrollUp\" STYLE=\"position:absolute; width:20px; height:20px; z-index:9; left: 820px; top: 225px; clip: rect(0px 20px 20px 0px)\"><FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=\"2\" COLOR=\"#DEDEDE\">
<A href=\"java script:;\" onMouseOver=\"PerformScroll(-3)\" onMouseOut=\"CeaseScroll()\" onFocus=\"this.blur()\"><IMG SRC=\"pics/scrollup.gif\" WIDTH=\"14\" HEIGHT=\"10\" ALT=\"\" BORDER=\"0\"></A></FONT></DIV>
<DIV ID=\"scrollDown\" STYLE=\"position:absolute; width:20px; height:20px; z-index:10; left: 820px; top: 340px; clip: rect(0px 20px 20px 0px)\"><FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=\"2\" COLOR=\"#DEDEDE\">
<A href=\"java script:;\" onMouseOver=\"PerformScroll(+3)\" onMouseOut=\"CeaseScroll()\" onFocus=\"this.blur()\"><IMG SRC=\"pics/scrolldown.gif\" WIDTH=\"14\" HEIGHT=\"10\" ALT=\"\" BORDER=\"0\"></A></FONT></DIV>
<DIV ID=\"divContainer\" STYLE=\"VISIBILITY: hidden; OVERFLOW: hidden; LEFT: 200px; WIDTH: 500px; TOP: 220px; HEIGHT: 130px; CLIP: rect(0px 500px 130px 0px); POSITION: absolute\">
<DIV ALIGN=\"justify\" ID=\"divContent\" STYLE=\"VISIBILITY: hidden; LEFT: 0px; POSITION: absolute; TOP: 0px\">
<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=\"2\" COLOR=\"#DEDEDE\">
<B>This page and LJ Webnologics is undergoing major changes.<BR><BR>
August 1<SUP>st</SUP> 2001, ljweb.com will reappear with new layout, functionality and services. We have teamed up with some excellent partners to ensure you an absolute top end-product.<BR><BR>
Company Headquarters will be relocated to Osaka, Japan and were looking forward to service you from our exciteing new location.<BR><BR>
Meanwhile, feel free to contact us at <A HREF=\"mailto:ljweb@ljweb.com\" onFocus=\"this.blur()\">ljweb@ljweb.com</A>.<BR><BR><BR>
To gain access our "old" website, please click <A HREF=\"http://www.ljweb.com/index_old.html\" onFocus=\"this.blur()\">this link</A>.</B>
</FONT>
</DIV>
</DIV>
</BODY>
</HTML>
Scroll_engine.js
var initialized;
var speed = 50;
var loop, timer;
function verifyCompatibleBrowser() {
this.ver = navigator.appVersion;
this.dom = document.getElementById?1:0;
this.ie5 = (this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;
this.ie4 = (document.all && !this.dom)?1:0;
this.ns5 = (this.dom && parseInt(this.ver) >= 5)?1:0;
this.ns4 = (document.layers && !this.dom)?1:0;
this.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns5) ;
return this;
}
function ConstructObject(obj,nest) {
nest = (!nest)?\'\':\'document.\'+nest+\'.\'
this.el = bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+\'document.\'+obj):0;
this.css = bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+\'document.\'+obj):0;
this.scrollHeight = bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight = bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up = MoveAreaUp;
this.down = MoveAreaDown;
this.MoveArea = MoveArea;
this.x;
this.y;
this.obj = obj+\"Object\";
eval(this.obj+\"=this\");
return this;
}
function PerformScroll(speed) {
if(initialized) {
loop = true;
if(speed>0) objScroller.down(speed);
else objScroller.up(speed);
}
}
function CeaseScroll() {
loop = false;
if(timer) clearTimeout(timer);
}
function MoveArea(x,y) {
this.x = x;
this.y = y;
this.css.left = this.x;
this.css.top = this.y;
}
function MoveAreaUp(move) {
if(this.y<0) {
this.MoveArea(0,this.y-move);
if(loop) setTimeout(this.obj+\".up(\"+move+\")\",speed);
}
}
function MoveAreaDown(move) {
if(this.y>-this.scrollHeight+objContainer.clipHeight) {
this.MoveArea(0,this.y-move);
if(loop) setTimeout(this.obj+\".down(\"+move+\")\",speed);
}
}
function InitializeScrollableArea() {
bw = new verifyCompatibleBrowser();
objContainer = new ConstructObject(\'divContainer\');
objScroller = new ConstructObject(\'divContent\',\'divContainer\');
objScroller.MoveArea(0,0);
objContainer.css.visibility = \'visible\';
initialized = true;
var position = xPos(\'menuContact\');
divContainer.style.left = position-480;
scrollUp.style.left = position+39;
scrollDown.style.left = position+39;
divContent.style.visibility = \"visible\";
scrollUp.style.visibility = \"visible\";
scrollDown.style.visibility = \"visible\";
}