Avatar billede bollocks Nybegynder
14. december 2001 - 21:39 Der er 2 kommentarer og
1 løsning

Links i menu

14 point er alt jeg har - desværre :-(
Jeg har følgende kode på en side, jeg skal have linket de forskellige punkter til min egne sider - uden at der åbnes et nyt vindue. Hvordan gør jeg det?<HTML><HEAD>
<TITLE>FODBOLDKLUBBEN - EZLN</TITLE>
<link rel=\"stylesheet\" type=\"text/css\" href=\"style2.css\">
<style type=\"text/css\">
.dot        { position: absolute; width: 8; height: 8; visibility: hidden; background-color: white; font-size: 1px; cursor: pointer; cursor: hand; z-index: 100 }
.dotoff      { position: absolute; width: 8; height: 8; visibility: hidden; background-color: gray; font-size: 1px; cursor:default; z-index: 100}
.dotempty    { position: absolute; width: 8; height: 8; visibility: hidden; background-color: orange; font-size: 1px; cursor: pointer; cursor: hand; zindex: 100 }
.caption    { position: absolute; visibility: hidden; font-family: Tahoma; color: white;
              font-size: 11px; text-align: Center; cursor: default; z-index:
              1 }

body          { margin: 0px; background-color: black; }
a              { color: silver; text-decoration: none }
p              { font-size: 10px; font-family: tahoma; color: black }
</style>
<script language=\"JavaScript\" type=\"text/javascript\">

function lib_bwcheck(){ //Browsercheck (needed)
    this.ver=navigator.appVersion
    this.agent=navigator.userAgent
    this.dom=document.getElementById?1:0
    this.opera5=(navigator.userAgent.indexOf(\"Opera\")>-1 && document.getElementById)?1:0
    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()

// The code of this script is in the body, the browsercheck above is not used.

</script>
       

<META NAME=\"Generator\" CONTENT=\"Stone\'s WebWriter 3\">
<Style type=\"text/css\">
#tickertape{
    position:relative;
    layer-background-color:black;
    text-align: center;
    height:50;
    width:290;
    vertical-align:middle;
}

#subtickertape{
    background-color:black;
    position:absolute;
    left:0;
    top:0;
    border: 1px solid black;
    width:700;
    height:50;
    text-align: center;
    vertical-align:middle;
}

.subtickertapefont{
top:0;
font:bold 30px Tahoma;
text-decoration:none;
color:white;
text-align: center;
}

.subtickertapefont a{
top:0;
color:white;
text-decoration:none;
text-align: center;
}
</style>

<Script Language=\"Javascript\"> <!-- //>

var debugOn = true;
function debug( str ) {
    if ( debugOn ) debugOn = confirm( str );
}; //end debug( string )

var ns4 = (document.layers)? true : false;
var ie  = (document.all) ? true : false;
var ns6 = (document.getElementById)? true : false;
var opera = (navigator.appName.indexOf(\'Opera\')>=0) ? true : false;
//debug( \"ns4:\"+ns4 +\" ie:\"+ie +\" ns6:\"+ns6 +\" Opera:\"+opera );

// --> </script>
<script language=\"JavaScript\">
<!--
//
function makearray(n) {
    this.length = n;
    for(var i = 1; i <= n; i++)
        this[i] = 0;
    return this;
}
hexa = new makearray(16);
for(var i = 0; i < 10; i++)
    hexa[i] = i;
hexa[10]=\"a\"; hexa[11]=\"b\"; hexa[12]=\"c\";
hexa[13]=\"d\"; hexa[14]=\"e\"; hexa[15]=\"f\";

function hex(i) {
    if (i < 0)
        return \"00\";
    else if (i > 255)
        return \"ff\";
    else
        return \"\" + hexa[Math.floor(i/16)] + hexa[i%16];
}

function setbgColor(r, g, b) {
    var hr = hex(r); var hg = hex(g); var hb = hex(b);
    document.bgColor = \"#\"+hr+hg+hb;
}

function fade(sr, sg, sb, er, eg, eb, step) {
    for(var i = 0; i <= step; i++) {
        setbgColor(
        Math.floor(sr * ((step-i)/step) + er * (i/step)),
        Math.floor(sg * ((step-i)/step) + eg * (i/step)),
        Math.floor(sb * ((step-i)/step) + eb * (i/step)));
    }
}

/* Usage:
*  fade(inr,ing,inb, outr,outg,outb, step);
* example.
*  fade(0,0,0, 255,255,255, 255);
* fade from black to white with very slow speed.
*  fade(255,0,0, 0,0,255, 50);
*  fade(0xff,0x00,0x00, 0x00,0x00,0xff, 50); // same as above
* fade from red to blue with fast speed.
* step 2 is very fast and step 255 is very slow.
*/

function fadein() {
    fade(255,255,255, 0,0,0, 150);
}

function fadeout() {
  fade(255,255,255, 0,0,0, 150);

}

/* do fadeout */
fadeout();
// -->
</script>

</HEAD>
<BODY BGCOLOR=\"#FFFFFF\" LINK=\"#0099CC\" ALINK=\"#FF0000\" VLINK=\"#006699\">
<body onload=\"if(ie||ns4||ns6){regenerate2();update()}\">
<br>
<script language=\"javascript1.2\" type=\"text/javascript\">
<!--
// DotMenu
// provides cross-browser functionality
//======================================
function getObjectRef(name) {
  if(document.getElementById) return document.getElementById(name);
  else if(document.all) return document.all[name];
  else return null;
}

// general functions to assist the script
//========================================
function show(name) {
  var el = getObjectRef(name);
  if(el) el.style.visibility = \"visible\";
}
function hide(name) {
  var el = getObjectRef(name);
  if(el) el.style.visibility = \"hidden\";
}
function getWidth(name) {
  var el = getObjectRef(name);
  return el.offsetWidth;
}
function getHeight(name) {
  var el = getObjectRef(name);
  return el.offsetHeight;
}
function moveMe(name,x,y) {
  var el = getObjectRef(name);
  if(el) { el.style.top = parseInt(y); el.style.left = parseInt(x); } 
}
function moveBy(name,x,y) {
  var el = getObjectRef(name);
  if(el) { el.style.top = parseInt(el.style.top) + parseInt(y); el.style.left = parseInt(el.style.left) + parseInt(x); } 
}

// Creates the menu objects
//==========================
var menuCount = 0;
function menuObject(name,x,y,caption, r, parent) {
  if ( (!document.getElementById&&!document.all) || navigator.userAgent.indexOf(\"Opera\")>-1) return;
  document.write(\'<div id=\"divDot\' + menuCount + \'\" class=\"dotempty\" style=\"top: \' + y + \'; left: \' + x + \'\"></div>\');
  document.write(\'<div id=\"divCap\' + menuCount + \'\" class=\"caption\" style=\"top: 0; left: 0\">\' + caption + \'</div>\');
 
  this.name = name;
  this.parent = parent
  this.ref = \"divDot\" + menuCount;
  this.caption = \"divCap\" + menuCount
  if(r) this.radius = r;
  else this.radius = 400;
  this.subMenus = new Array();
  this.state = 0;
  this.moving = false;
  if(this.parent) this.action = \"null\";
  else this.action = \"toggle\";
  if(this.parent) this.startAngle = parent.startAngle;
  else this.startAngle = 0;

  getObjectRef(this.ref).objRef = this.name;
 
  this.show = function() { show(this.ref); }
  this.hide = function() { hide(this.ref); }
  this.moveMe = function(x,y) { if(this.parent) { x += this.parent.x(); y += this.parent.y(); } moveMe(this.ref,x,y); }
  this.moveBy = function(x,y) { moveBy(this.ref,x,y); }
  this.x = function() { return parseInt(getObjectRef(this.ref).style.left); }
  this.y = function() { return parseInt(getObjectRef(this.ref).style.top); }
  this.w = function() { return getWidth(this.ref); }
  this.h = function() { return getHeight(this.ref); }

  this.showCaption = function() {
    moveMe(this.caption, this.x() - (getWidth(this.caption)/2) + (this.w()/2), (this.y() + this.h()));
    show(this.caption);
  }
  this.hideCaption = function() {
    hide(this.caption);
  }
  this.setCaption = function(c) { getObjectRef(this.caption).innerHTML = c;}

  this.addItem = function(c,action,r) {
    getObjectRef(this.ref).className = \"dot\";
    if(!r) r = this.radius/2;
    var sub = new menuObject(this.name + \".subMenus[\" + this.subMenus.length + \"]\",0,0,c,r,this);
    sub.parent = this;
    sub.action = action;
    sub.moveMe(0,0);
    this.subMenus[this.subMenus.length] = sub;
    return sub;
  }
 
  this.expand = function() {
    if(this.subMenus.length > 0) {
      var p = true;
      if(this.parent) {
        p = !this.parent.moving;
        for(var i=0; i<this.parent.subMenus.length;i++)
          p = p && ((this.parent.subMenus[i].state==0) || (this.parent.subMenus[i].state==this.parent.subMenus[i].subMenus.length)) && (this.parent.subMenus[i].moving==false);
      } else var o = false;
     

      if((!this.parent || this.parent.state == this.parent.subMenus.length) && p) {
        if(this.parent) this.collapseAll(this.name);
       
        var diff = 360 / this.subMenus.length;
        for(var i=0;i<this.subMenus.length;i++){
          this.subMenus[i].moveMe(0,0);
          this.subMenus[i].show();
          this.moving = true;
          this.subMenus[i].slide(this.subMenus[i].radius * cos(degToRad((diff*i)+this.startAngle)), this.subMenus[i].radius * sin(degToRad((diff*i)+this.startAngle)), this.name + \".subMenus[\" + i + \"].showCaption();\" + this.name + \".moving=false;\" + this.name + \".state+=1;\");
        }
        if(this.parent){
          getObjectRef(this.parent.ref).style.filter = \"alpha (opacity=33)\";
          getObjectRef(this.parent.ref).style.MozOpacity = \"33%\";

          getObjectRef(this.parent.ref).className = \"dotoff\";
          getObjectRef(this.parent.caption).style.filter = \"alpha (opacity=33)\";
          getObjectRef(this.parent.caption).style.MozOpacity = \"33%\";
          for(i=0;i<this.parent.subMenus.length;i++) {
              getObjectRef(this.parent.subMenus[i].ref).style.filter = \"alpha (opacity=66)\";
              getObjectRef(this.parent.subMenus[i].ref).style.MozOpacity = \"66%\";
              getObjectRef(this.parent.subMenus[i].caption).style.filter = \"alpha (opacity=66)\";
              getObjectRef(this.parent.subMenus[i].caption).style.MozOpacity = \"66%\";       
          }
          if(this.parent.parent) {
            for(i=0;i<this.parent.parent.subMenus.length;i++) {
              getObjectRef(this.parent.parent.subMenus[i].ref).style.filter = \"alpha (opacity=33)\";
              getObjectRef(this.parent.parent.subMenus[i].ref).style.MozOpacity = \"33%\";
              getObjectRef(this.parent.parent.subMenus[i].ref).className = \"dotoff\";
              getObjectRef(this.parent.parent.subMenus[i].caption).style.filter = \"alpha (opacity=33)\";       
              getObjectRef(this.parent.parent.subMenus[i].caption).style.MozOpacity = \"33%\";
            }
            getObjectRef(this.parent.parent.ref).style.MozOpacity = \"33%\";
            getObjectRef(this.parent.parent.ref).style.MozOpacity = \"33%\";
            getObjectRef(this.parent.parent.ref).className = \"dotoff\";
          }
        }
        getObjectRef(this.ref).style.filter = \"alpha (opacity=66)\";
        getObjectRef(this.caption).style.filter = \"alpha (opacity=66)\"; 
        getObjectRef(this.ref).style.MozOpacity = \"66%\";
        getObjectRef(this.caption).style.MozOpacity = \"66%\";
      }
    } 
  }

  this.collapse = function() {
    var p = true;
    p = !this.moving;
    for(var i=0; i<this.subMenus.length;i++)
      p = p && (this.subMenus[i].state==0)  && (this.subMenus[i].moving==false);
   
    if(p && this.subMenus.length > 0) {
      for(var i=0;i<this.subMenus.length;i++){
        this.subMenus[i].hideCaption();
        this.moving = true;
        this.subMenus[i].slide(0, 0, this.name + \".subMenus[\" + i + \"].hide();\" + this.name + \".moving=false;\" + this.name + \".state-=1;\");
      }
      if(this.parent){
        getObjectRef(this.parent.ref).style.filter = \"alpha (opacity=66)\";
        getObjectRef(this.parent.ref).style.MozOpacity = \"66%\";
        if(this.parent.subMenus.length != 0)
          getObjectRef(this.parent.ref).className = \"dot\";
        else
          getObjectRef(this.parent.ref).className = \"dotempty\";
        getObjectRef(this.parent.caption).style.filter = \"alpha (opacity=66)\";
        getObjectRef(this.parent.caption).style.MozOpacity = \"66%\";
        for(i=0;i<this.parent.subMenus.length;i++) {
          getObjectRef(this.parent.subMenus[i].ref).style.filter = \"alpha (opacity=100)\";
          getObjectRef(this.parent.subMenus[i].ref).style.MozOpacity = \"100%\";
          if(this.parent.subMenus[i].subMenus.length != 0)
            getObjectRef(this.parent.subMenus[i].ref).className = \"dot\";
          else
            getObjectRef(this.parent.subMenus[i].ref).className = \"dotempty\";
          getObjectRef(this.parent.subMenus[i].caption).style.filter = \"alpha (opacity=100)\";       
          getObjectRef(this.parent.subMenus[i].caption).style.MozOpacity = \"100%\";
        }
        if(this.parent.parent) {
          for(i=0;i<this.parent.parent.subMenus.length;i++) {
            getObjectRef(this.parent.parent.subMenus[i].ref).style.filter = \"alpha (opacity=66)\";
            getObjectRef(this.parent.parent.subMenus[i].ref).style.MozOpacity = \"66%\";
            if(this.parent.parent.subMenus[i].subMenus.length != 0)
              getObjectRef(this.parent.parent.subMenus[i].ref).className = \"dot\";
            else
              getObjectRef(this.parent.parent.subMenus[i].ref).className = \"dotempty\";
            getObjectRef(this.parent.parent.subMenus[i].caption).style.filter = \"alpha (opacity=66)\";       
            getObjectRef(this.parent.parent.subMenus[i].caption).style.MozOpacity = \"66%\";
          }
        }
      }
      getObjectRef(this.ref).style.filter = \"alpha (opacity=100)\";
      getObjectRef(this.caption).style.filter = \"alpha (opacity=100)\";     
      getObjectRef(this.ref).style.MozOpacity = \"100%\";
      getObjectRef(this.caption).style.MozOpacity = \"100%\";
    }
  }

  this.collapseAll = function(except) {
    for(var i=0;i<this.parent.subMenus.length;i++) {
      if(this.parent.subMenus[i].name!=except && this.parent.subMenus[i].state==this.parent.subMenus[i].subMenus.length) {
        this.parent.subMenus[i].collapse();
      }   
    }
  }
 
  this.toggle = function(e) {
    if(document.all) id = window.event.srcElement;
    else id = e.target;
    var dot = eval(id.objRef);
   
    if(dot.state==0 && !dot.moving) dot.expand();
    else if(dot.state==dot.subMenus.length && !dot.moving) dot.collapse()
  }
 
  this.doAction = function(e) {
    if(document.all) id = window.event.srcElement;
    else id = e.target;
    var dot = eval(id.objRef);
   
    if(dot.action == \"toggle\") dot.toggle(e);
    else eval(dot.action);
  }
 
  //change these if you want to change the events that trigger the actions
  //========================================================================
  //getObjectRef(this.ref).onmousemove = this.toggle;
  getObjectRef(this.ref).onmouseup = this.doAction;
 
  this.slide = function(xx,yy,func) {
    if(!func) func = \"\";
    var px = this.parent.x();
    var py = this.parent.y();
   
    var x = xx - this.x() + px;
    var y = yy - this.y() + py;
   
    var d = sqrt(square(xx-this.x() + px) + square(yy-this.y() + py));
   
    var v = d/8;
    if(v<1) v = 1;
       
    if( (Math.abs(x) < v) && (Math.abs(y) < v) ) {
      moveMe(this.ref,xx + px,yy + py);     
      if(func != \"\") eval(func);
    } else {   
      var a = round(atan(x,y));
      dx = round(v * cos(degToRad(a)));
      dy = round(v * sin(degToRad(a)));
 
      this.moveBy(dx,dy);
      setTimeout(this.name + \".slide(\" + xx + \",\" + yy + \", \'\" + func + \"\');\",10);   
    }
  }
  // Preoading the windows filters.
  if (menuCount==0 && document.all) document.all[this.ref].style.filter = \"alpha (opacity=100)\";
  menuCount++;
  return this;
}


// Math functions
//================
var pi = Math.PI;
function square(x) { return (x*x); }
function sqrt(x) { return Math.sqrt(x); }
function round(x) { return Math.round(x); }
function rand(x,y) { return (round(Math.random()*(y-x)) + x); }

function cos(x) { return Math.cos(x) }
function sin(x) { return Math.sin(x) }
   
function degToRad(x) { return ( x/(360/(2*pi)) ); }
function radToDeg(x) { return ( x*(360/(2*pi)) ); }


function atan(s,t) {
  if( s == 0.0 && t > 0.0)
    angle = 90.0;
  else if(s == 0.0 && t < 0.0)
    angle = 270.0;
  else if (s < 0.0 )
    angle = 180.0 + radToDeg(Math.atan(t/s));
  else if (s > 0.0 && t < 0.0)
    angle = 360.0 + radToDeg(Math.atan(t/s));
  else {
    if(s==0.0) s=0.00001;
    angle = radToDeg(Math.atan(t/s));
  }
  if(angle < 0.0) angle += 360.0;
  return angle;
}



//====================================================================================
// make the menus and provide information on usage
//====================================================================================
//
// In order to customise your menus all you need to do is:
//  - edit the styles .dot, .dotoff and .caption
//  - add the main menu using the following code
//        var [menu_name] = new menuObject(\"[menu_name]\", [x position], [y position], [caption], [spacing between sub menus]);
//  - add the subemus using:
//        var [sub_menu] = [menu_name].addItem([caption],[action],[spacing]);
//      OR
//        var [sub-sub_menu] = [sub_menu].addItem([caption],[action],[spacing]);
//      OR
//        [menu_name].subMenus[x].addItem([caption],[action],[spacing]);
//
//      - where action is string that get\'s evaluated when the dot is clicked
//
//      (NOTE the spacing is optional and if left blank gets inherited
//            and is equal to the  (parent\'s value)/2 - the default for
//            the main menu item uis 400)
//
//  - the following allow extra manipulation of the menus:
//          + menuItem.show()              - show\'s the menu\'s dot
//          + menuItem.showCaption()      - show\'s the menu\'s caption
//          + menuItem.hide()
//          + menuItem.hideCaption()
//          + menuItem.startAngle = x      - default is 0-degrees which means the first submenu appears
//                                          directly to the right, the following items are traced in a
//                                          clockwise direction
//          + menuItem.setCaption(\"text\")  - allows you to change a menus caption
//          + menuItem.expand()            - opens a menus submenus (if they exist)
//          + menuItem.collapse()          - closes a menu\'s subItems (unless one of them is open)
//
//          + menuItem.moveMe(x,y)        - moves a menu to coordinates (x,y)
//          + menuItem.moveBy(x,y)        - moves a menu by (x,y)-pixels
//          + menuItem.x() & menuItem.y()  - retrieve a menus coordinates
//
//====================================================================================

//get dimentions of the page
if(document.all) pageWidth = document.body.offsetWidth-20;
else pageWidth = innerWidth;
if(document.all) pageHeight = document.body.offsetHeight-4;
else pageHeight = innerHeight;

//Create main menu
var menu = new menuObject(\"menu\",pageWidth/2,pageHeight/2,\"MENU\",pageHeight/2);
menu.startAngle = -90;

//show menu and caption
menu.show();
menu.showCaption();

//Add submenus
menu.addItem(\"Nyheder\",\"window.open(\'index.html\')\");
menu.addItem(\"Stilling\",\"toggle\");
menu.addItem(\"Links\",\"toggle\");
menu.addItem(\"Kontakt os\",\"toggle\");
menu.addItem(\"Spillere\",\"toggle\");

menu.subMenus[1].addItem(\"FoldOutMenu\",\"window.open(\'/script/script22.asp\')\");
menu.subMenus[1].addItem(\"Loading Bar\",\"window.open(\'/script/script17.asp\')\");
menu.subMenus[1].addItem(\"Window Script\",\"window.open(\'/script/script16.asp\')\");
menu.subMenus[1].addItem(\"PageSlideFade\",\"window.open(\'/script/script15.asp\')\");
menu.subMenus[1].addItem(\"Circle Menu\",\"window.open(\'/script/script14.asp\')\");
menu.subMenus[1].addItem(\"Annimation Intro\",\"window.open(\'/script/script9.asp\')\");
menu.subMenus[1].addItem(\"NewsSlideFade\",\"window.open(\'/script/script10.asp\')\");
menu.subMenus[1].addItem(\"Other Scripts\",\"window.open(\'/script/\')\");


menu.subMenus[2].addItem(\"Fodbold Links\",\"window.open(\'/tutorials/tutorial5.asp\')\");
menu.subMenus[2].addItem(\"Sponsor Links\",\"window.open(\'/tutorials/tutorial6.asp\')\");
menu.subMenus[2].addItem(\"Tak for hjælpen\",\"window.open(\'/tutorials/tutorial4.asp\')\");

menu.subMenus[3].addItem(\"Spillere.\",\"window.open(\'/forums\')\");
menu.subMenus[3].addItem(\"Sponsor afd.\",\"window.open(\'/forums/forum.asp?FORUM_ID=1&CAT_ID=1&Forum_Title=Cool+sites\')\");
menu.subMenus[3].addItem(\"Træner\",\"window.open(\'/forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus\')\");
menu.subMenus[3].addItem(\"Webmaster\",\"window.open(\'/forums/forum.asp?FORUM_ID=3&CAT_ID=1&Forum_Title=Crossbrowser+DHTML\')\");
menu.subMenus[3].addItem(\"Fan Klub\",\"window.open(\'/forums/forum.asp?FORUM_ID=4&CAT_ID=1&Forum_Title=DHTML+Scripts\')\");


c = menu.subMenus[4].addItem(\"Søren\",\"toggle\");
c.startAngle = 15;
menu.subMenus[4].addItem(\"Dennis B.\",\"window.open(\'/resources/default.asp?catid=1&cattitle=Script+sites\')\");
menu.subMenus[4].addItem(\"Alexander\",\"window.open(\'/resources/default.asp?catid=1&cattitle=Script+sites\')\");
menu.subMenus[4].addItem(\"Lars Bronx\",\"toggle\");
menu.subMenus[4].addItem(\"Shultz\",\"toggle\");
menu.subMenus[4].addItem(\"Claus Pan\",\"toggle\");
menu.subMenus[4].addItem(\"Kasper B.\",\"toggle\");
menu.subMenus[4].addItem(\"Dennis D\",\"toggle\");





//--></script>




       
<Script Language=\"Javascript\"> <!-- // det skader aldrig og KAN hjælpe

var speed=5000

var news = new Array()
news[0]=\'      FODBOLDKLUBBEN - EZLN\';


var tmp,i,j;
for (i=news.length; i>0;  ) {
    tmp = news[ j = Math.floor( Math.random()*i-- ) ];
    news[j] = news[i];
    news[i] = tmp;
} // nu står elementerne i news arrayet i en helt tilfeldig rækkefølge.

if( ( ie || ns4 || ns6 || opera) && navigator.userAgent.indexOf(\'Win\')!= -1) {
document.write(\'<div id=\"tickertape\" align=\"center\"><div id=\"subtickertape\" class=\"subtickertapefont\" align=\"center\">\'+news[news.length-1]+\'</div></div>\')
}
var i = 0;
var tickerobject;            // i regenerate2() så den først sættes onload
var inc, step, tmp;          // \\
var sred, sgrn, sblu;        //  > erklæeres som variable i dette objekt
var ered, egrn, eblu;        // /

function regenerate() {
    window.location.reload()
}
function regenerate2(){
    if (ie) {
        tickerobject=document.all.subtickertape.style
    } else
    if (ns4) {
        tickerobject=document.tickertape.document
        setTimeout(\"window.onresize=regenerate\",450);
    } else
    if (ns6||opera) {
        tickerobject=document.getElementById(\"subtickertape\").style
    }
//debug( \"tickerobjedct is: \" +tickerobject );
}

var tabStart = \'<t\\able width=\"100%\" border=0 align=\"center\"><tr><td align=\"center\" valign=\"top\"><s\\pan class=\"subtickertapefont\">\'
var tabSlut  = \'</s\\pan></td></tr></t\\able>\'

function update(){
    BgFade(0xff,0xff,0xff,0x00,0x00,0x00,10);
//debug( news[i] );
    if (ns4){
        document.tickertape.document.subtickertape.document.write(tabStart
                                                        +news[i]+tabSlut);
        document.tickertape.document.subtickertape.document.close()
    } else
    if (ie){
        document.all.subtickertape.innerHTML=tabStart+news[i]+tabSlut;
    } else
    if (ns6||opera){
        var xxelm = document.getElementById(\"subtickertape\")
//debug( \"ns6+Opera \"+xxelm.id+\"\\n\"+news[i] );
        xxelm.innerHTML=tabStart+news[i]+tabSlut;
    }

    if ( ++i>=news.length ) i=0;

   
}

function BgFade(red1, grn1, blu1, red2, grn2, blu2, steps) {
    sred = red1; sgrn = grn1; sblu = blu1;
    ered = red2; egrn = grn2; eblu = blu2;
    inc = steps;
    step = 0;
    RunFader();
};

function RunFader() {
    var epct = step/inc;
    var spct = 1 - epct;
    if (ns4) {
        tickerobject.bgColor =
            Math.floor(sred * spct + ered * epct)*256*256 +
            Math.floor(sgrn * spct + egrn * epct)*256 +
            Math.floor(sblu * spct + eblu * epct);
    } else
    if ( opera ) {
        tickerobject.background = \"rgb(\" +
            Math.floor(sred * spct + ered * epct) +\",\" +
            Math.floor(sgrn * spct + egrn * epct) +\",\" +
            Math.floor(sblu * spct + eblu * epct) +\")\";
    } else
    if(ie||ns6) {    // Jeg mener  \'rgb(rød,grøn,blå)\' er mere korrekt
        tickerobject.backgroundColor = \"rgb(\" +
            Math.floor(sred * spct + ered * epct) +\",\" +
            Math.floor(sgrn * spct + egrn * epct) +\",\" +
            Math.floor(sblu * spct + eblu * epct) +\")\";
    }

    if ( ++step <= inc ) setTimeout(\'RunFader()\',100);
}

// --> </script>



<img src=\"zap2002.jpg\" width=\"200\" height=\"300\">
<CENTER>


</CENTER>

</FONT></TR></TD></TABLE></BODY></HTML>

Avatar billede jakoba Nybegynder
14. december 2001 - 23:00 #1
der hvor du indsætter menupunkter med funktionen addItem er anden parameter en javascript streng ( her \"window.open(\'/script/script22.asp\')\" ). når der trykkes på det menypunkt bliver strengen udført som javascript kode

menu.subMenus[1].addItem(\"FoldOutMenu\",
                          \"window.open(\'/script/script22.asp\')\"
                          );

lav strengen om til en der ikke åbner et vindue. men skifter side i den ramme du vil have ændret. fx:

\"menu.subMenus[1].addItem(\"FoldOutMenu\",
                          \"parent.mainramme.location.href=\'/script/script22.asp\')\"
                            );

\'mainramme\' skal være det navn du gav rammen med en  name=\'mainramme\'  atrubut i <frame kommandoen

mvh JakobA
Avatar billede bollocks Nybegynder
14. december 2001 - 23:09 #2
JEg tror ikke helt jeg har fattet hvad du mener, kan du prøve at skrive det ind i koden?
Avatar billede jakoba Nybegynder
14. december 2001 - 23:29 #3
  parent.mainramme.location.href=\'/script/script22.asp\'
er en javascript sætning der henter Websiden \'/script/script22.asp\' ind i en ramme der har navnet \'mainframe\'.

Du skal bruge en lignende sætning der henter den side du vil have ind i din ramme.

NB: jeg lavede en fejl i det jeg skrv sidst. der skal ikke være slutparentes forenden af strengen. så ret til:

\"menu.subMenus[1].addItem(\"FoldOutMenu\",
                          \"parent.mainramme.location.href=\'/script/script22.asp\'\"
                            );

mvh JakobA
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