Avatar billede lubbers Nybegynder
28. januar 2002 - 14:41 Der er 3 kommentarer

netscape6.2 vs 4.7

Jeg har et scrollelag der ikke vil fungere i 6.2, er der en der kender til problemet???

<HTML>
<HEAD>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<LINK REL="STYLESHEET" HREF="lib/style.css">
<SCRIPT LANGUAGE="JavaScript">
function tjekForm(acount) {
var ok=0
var count = acount
    for(var i=1;i<=count;i++){
        if (document.myform.elements[i+1].checked==true){
            ok++
        }
    }
    if(ok>=1)
    return true
    else
    alert("Hvilket katalog vil du bestille?")
    return false
}

function tjekFelt(hvilket) {
        if(document.minform[hvilket].value.length < 1 || document.minform[hvilket].value.length < "")    {
            alert("Du mangler at udfylde feltet: " + hvilket)
            document.minform[hvilket].focus()
            return false
            }
        else return true
}
function lib_bwcheck(){ //Browsercheck (needed)
    this.ver=navigator.appVersion
    this.agent=navigator.userAgent
    this.dom=document.getElementById?1:0
    this.opera5=this.agent.indexOf("Opera 5")>-1
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
    this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
    this.ie=this.ie4||this.ie5||this.ie6
    this.mac=this.agent.indexOf("Mac")>-1
    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
    return this
}
var bw=new lib_bwcheck()
//If you want it to move faster you can set this lower:
var speed=50

//Sets variables to keep track of what's happening
var loop, timer

//Object constructor
function makeObj(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.clipTop=bw.ns4?this.css.document.top:this.el.top
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
    this.up=goUp;this.down=goDown;
    this.moveIt=moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function moveIt(x,y){
    this.x=x;this.y=y
    this.css.left=this.x
    this.css.top=this.y
}

goUpTimeout = null
goDownTimeout = null

//Makes the object go up
function goDown(move){
    if(this.y>-this.scrollHeight+oCont.clipHeight){
        this.moveIt(0,this.y-move)
            if(loop)
                {
                    if (goUpTimeout != null)
                        clearTimeout(goUpTimeout)
                    goDownTimeout = setTimeout(this.obj+".down("+move+")",speed)
                }
    }
}
//Makes the object go down
function goUp(move){
    if(this.y<0){
        this.moveIt(0,this.y-move)
        if(loop)
            {
                if (goDownTimeout != null)
                    clearTimeout(goDownTimeout)
                goUpTimeout = setTimeout(this.obj+".up("+move+")",speed)
            }
    }
}
//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
    if(loaded){
        loop=true;
        if(speed>0) oScroll.down(speed)
        else oScroll.up(speed)
    }
}

//Stops the scrolling (called on mouseout)
function noScroll(){
    loop=false
    if(timer) clearTimeout(timer)
}
//Makes the object
var loaded;

function scrollInit(){
    oCont=new makeObj('divCont')
    oScroll=new makeObj('divText','divCont')
    oScroll.moveIt(0,0)
    oCont.css.visibility='visible'
    loaded=true;
    //alert(oScroll.scrollHeight)
    //if (!ns4)
    if (oScroll.scrollHeight < 50) {
        if (ie4)
            divPil.style.visibility = "hidden"
        if (ns4)
            document["divPil"].visibility = "hidden"
        if (ns6)
            document.getElementById("divPil").style.visibility = "hidden"
        }
}
//Call the init on page load
onload=scrollInit;

version = parseInt(navigator.appVersion);
ns  = navigator.appName.indexOf("Netscape")!=-1;
ns4 = (ns && (version == 4));

ns  = navigator.appName.indexOf("Netscape")!=-1;
ns6 = (ns && (version == 5));

ie  = navigator.appName.indexOf("Microsoft")!=-1;
ie4  = (ie && (version >= 4));

if(ns4)
{    doc = "document.layers";
    sty = "";
    htm = ".document";
}
else if(ie4)
{    doc = "document.all";
    sty = ".style";
    htm = "";
}
else if(ns6)
{    doc = "document.getElementById(";
    sty = ").style";
    htm = "";
}
oldObj = false
oldAObj = false

function visMenu(hvilken) {
    if (oldObj != false)
        oldObj.visibility = 'hidden'
       
    mitDivObj = eval(doc + '["div" + hvilken]' + sty);
       
    mitDivObj.position = "absolute"
    mitDivObj.top = 134
    mitDivObj.left = 113
    mitDivObj.visibility = 'visible'

    oldObj = eval(mitDivObj)

if (ie) {   
    mitDivAobj = eval(doc + '["divA" + hvilken]' + sty);
    mitDivAobj.color = 'white';

    if (oldAObj != false)
        oldAObj.color = '#CBD5E7'
   
    oldAObj = eval(mitDivAobj)
    }
}
//Rød knap ved menu
mg = new Image()
if (ie)
    mg.src = 'images/menu.gif'
else if (ns6)
    mg.src = 'images/menu_n6.gif'
else
    mg.src = 'images/menu_nn.gif'

function cI(d,h) {
if(ie4||ns6) {
    imgN = eval("document."+"img"+h)
    imgN.src=mg.src }
else
    document.layers["div"+d].document.images["img"+h].src = mg.src
}
function cB(d,h) {
if(ie4||ns6) {
    imgN = eval("document."+"img"+h)
    imgN.src='images/spacer.gif'
}
else
    document.layers["div"+d].document.images["img"+h].src = 'images/spacer.gif'
}

</SCRIPT>
<style>
#divCont{position:relative;width:400px; height:200px; overflow:hidden; top:0; left:0;  visibility:hidden;}
#divText{position:absolute; top:0px; left:0px;font-family:verdana;font-size:11px;line-height:14px;color:#ffffff;}
</style>
<div id="divPil">
        <br><br><br><br><a href="#" onmouseover="scroll(-5)" onmouseout="noScroll()"><img src="images/pil_op.gif" border="0" name="pilop"></a><br><a href="#" onmouseover="scroll(5)" onmouseout="noScroll()"><img src="images/pil_ned.gif" border="0" name="pilned"></a></div>

</HEAD>
<BODY bgcolor="#008000">

<TABLE WIDTH=400 BORDER=0 CELLPADDING=0 CELLSPACING=0 height=400>
    <tr><td height=100><IMG SRC="images/8pics/8pic_01.gif" WIDTH=177 HEIGHT=33></td></tr>
    <tr><td height=200>

<div id="divCont"><div id="divText">
    <table><tr><td>
        '------------------------------- Overskrifter ------------------------------
                txtCont = recCont("content")
                If txtCont <> "" Then
                    txtCont = Replace(txtCont,"<DIV style=""FONT-SIZE: 12px; FONT-FAMILY: verdana"">" ,"")
                    txtCont = Replace(txtCont,"</DIV>" ,"<br>")
                    txtCont = Replace(txtCont,"<br><br>" ,"<br>")
                    txtCont = Replace(txtCont,"<DIV style=""FONT-FAMILY: verdana; FONT-SIZE: 12px"">" ,"")'--------------------- 8 billeder + tekst --------------------  %>
    strPic = "SELECT * FROM tblPic WHERE pId=" & pId
        strPic2 = "SELECT * FROM tblPic2 WHERE pId=" & pId
        Set recPic = dbconn.Execute(strPic)
        Set recPic2 = dbconn.Execute(strPic2)
            If not recPic.eof Then

                Else
                    txtCont = "Ingen tekst i WebFactory..."
                End If
                Response.Write "<div align=right>"
                pos1 = inStr(txtCont,"<H1>")
                While pos1 > 0
                    If pos1 > 0 Then
                        pos2 = inStr(pos1,txtCont,"</H1>")
                        overskrift = mid(txtCont,pos1+4,pos2-pos1-4)
                        Response.Write "&nbsp;&nbsp;&nbsp;" & overskrift
                    End    If
                    pos1 = inStr(pos2,txtCont,"<H1>")
                Wend
                Response.Write "</div>"
            '------------------------------- Indhold ------------------------------   
                Response.Write "<p align=""left"">"
        </td></tr></table>
        </div></div>

</td></tr>
    <TR><TD BGCOLOR=#495460 VALIGN="TOP" height="100"><IMG SRC="images/spacer.gif" WIDTH=22 HEIGHT=1></TD>
</tr></table>
Avatar billede lubbers Nybegynder
28. januar 2002 - 14:50 #1
PS.
Lad være med at kigge på koden inden du har set den i browseren
ASP'en er bare tekst.
Filen skal hedde .htm
Avatar billede hoejrup Nybegynder
28. januar 2002 - 15:56 #2
Har du prøvet at teste den på http://validator.w3.org/?

/per
Avatar billede lubbers Nybegynder
28. januar 2002 - 15:59 #3
ja, men det har ikke hjulpet
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester