I have the following script for a Layer popup, so my visitors can get help for particular words.
(Thanks to Vinny for the code)PHP Code:var oldX = oldY = 0;
function scrollDiv(divID) {
var yHome = xHome = 100;
var yPos = (document.all || document.getElementById) ? document.body.scrollTop : window.pageYOffset;
var xPos = (document.all || document.getElementById) ? document.body.scrollLeft : window.pageXOffset;
var divStyle = (document.getElementById) ? document.getElementById(divID).style : ( (document.all) ? document.all[divID].style : document.layers[divID] );
if ('note'.indexOf(divID.substr(0,3)) != -1)
oldY = resetXY(divStyle, false, yPos, yHome)
else {
if (yPos != oldY) oldY = resetXY(divStyle, false, yPos, yHome)
if (xPos != oldX) oldX = resetXY(divStyle, true, xPos, xHome)
}
}
function resetXY(divObj, isX, xyVal, xyOffset) {
if (isX) divObj.left = xyOffset + xyVal;
else divObj.top = xyOffset + xyVal;
return (xyVal);
}
function init(divID){
scrollDiv(divID);
setTimeout("init('"+ divID + "')", 5);
}
function doSel(selObj){
for (i=0; i< selObj.length; i++)
if (selObj.options[i].selected)
eval(selObj.options[i].value)
}
function changeVis(divID,isShow){
divStyle = (document.layers) ? document.layers[divID] : ( (document.getElementById)? document.getElementById(divID).style : document.all[divID].style );
divStyle.visibility = (isShow) ? 'visible' : ( (document.layers) ? 'hide' : 'hidden');
}
Is it Possible to allow the visitor to move the Layer with his/her mouse???
And if so: can the script remember this location and popup the next Layers there as well?
Any help will be appreciated!
Jazz




Bookmarks