Forums

This topic is locked

how to...

Posted 05 Dec 2002 11:32:26
1
has voted
05 Dec 2002 11:32:26 Dan The Man posted:
i am have trouble. only half of my extention works i can't get it to put the javascript in the head of a document. how would can i do this?

Replies

Replied 05 Dec 2002 11:59:03
05 Dec 2002 11:59:03 Martha Graham replied:
Can you explain what extension you are using?

Martha Graham
Replied 06 Dec 2002 12:00:01
06 Dec 2002 12:00:01 Dan The Man replied:
i am creating one; here's the code:
// Copyright 2002 ShrineDesigns. All rights reserved.
// email: , website: www.angelfire.com/anime4/shrinedesigns/

// The function that will be inserted into the HEAD of the user's document
function SD_shiftingLayers(obj,X,Y,W,H) { // ver 1.00
if (document.getElementById) {
SD = document.getElementById(obj).style;
}
else if (document.all){
SD = document.all[obj].style;
}
else if (document.layers) {
SD = document.layers[obj];
}
SD.left = X; // horizontal position
SD.top = Y; // vertical position
SD.width = W; // layer width
SD.height = H; // layer height
}

//--------------- API FUNCTIONS ---------------

function isDOMRequired() {
// Return false, indicating that this object is available in code view.
return false;
}

function objectTag(div) {
var rtnStr="";
var DivId = document.forms[0].Layer.value;
if (div)
return '<div id="' + DivId + '" style="' + div + '"><\/div>';

// Return the html tag that should be inserted
var InTopPos = document.forms[0].iTopPos.value;
var SelTopUnits = document.forms[0].iTopMsr.selectedIndex;
var TopUnits = document.forms[0].iTopMsr.options[SelTopUnits].value;
var InLeftPos = document.forms[0].iLeftPos.value;
var SelLeftUnits = document.forms[0].iLeftMsr.selectedIndex;
var LeftUnits = document.forms[0].iLeftMsr.options[SelLeftUnits].value;
var InWidth = document.forms[0].iWidth.value;
var SelWidthUnits = document.forms[0].iWidthMsr.selectedIndex;
var WidthUnits = document.forms[0].iWidthMsr.options[SelWidthUnits].value;
var InHeight = document.forms[0].iHeight.value;
var SelHeightUnits = document.forms[0].iHeightMsr.selectedIndex;
var HeightUnits = document.forms[0].iHeightMsr.options[SelHeightUnits].value;

var OverTopPos = document.forms[0].overTopPos.value;
var OverLeftPos = document.forms[0].overLeftPos.value;
var OverWidth = document.forms[0].overWidth.value;
var OverHeight = document.forms[0].overHeight.value;

var OutTopPos = document.forms[0].outTopPos.value;
var OutLeftPos = document.forms[0].outLeftPos.value;
var OutWidth = document.forms[0].outWidth.value;
var OutHeight = document.forms[0].outHeight.value;

rtnStr = '<div id="' + DivId + '" style="position:absolute; overflow:hidden; top:' + InTopPos + '' + TopUnits + '; left:' + InLeftPos + '' + LeftUnits + '; height:' + InHeight + '' + HeightUnits + '; width:' + InWidth + '' + WidthUnits + ';" onMouseOver="SD_ShifthingLayers(' + DivId + ',' + OverTopPos + ',' + OverLeftPos + ',' + OverHeight + ',' + OverWidth + ')" onMouseOut="SD_ShiftingLayers(' + DivId + ',' + OutTopPos + ',' + OutLeftPos + ',' + OutHeight + ',' + OutWidth + ')"></div>';
return rtnStr;
}


Edited by - ANIMESHRINE1134 on 06 Dec 2002 12:01:30

Reply to this topic