/    Sign up×
Community /Pin to ProfileBookmark

Help with helpbox popups

I am a sysadmin, so most of this was cut and paste and most likely butchered (in short, i dont know javascript). The script is working with one small problem. The page is simply a flowchart to help our helpdesk troubleshoot. They can mouseover a step in the flowchart, and a popup will appear with greater detail. The window is popping right in the middle of the page (where there are mouseover areas), and i need to move it to the right and up, where there are no mousover areas. Any ideas on how to control the popups position within the browser?

Thanks

function helpmsg(header, hstyle, mstyle, message) {
this.DEFAULTHSTYLE = “plain”;
this.DEFAULTMSTYLE = “plain”;

this.header = header;
if (hstyle) this.hstyle = hstyle;
else this.hstyle = this.DEFAULTHSTYLE;
this.message = message;
if (mstyle) this.mstyle = mstyle;
else this.mstyle = this.DEFAULTMSTYLE;
return this;
}
new helpmsg();
helpmsg.prototype.show = show;

function show() {
var H = “<FONT FACE=’arial’>” + this.header + “</FONT>”;
if (this.hstyle == “h1”) H = “<H1>” + H + “</H1>”;
else if (this.hstyle == “h2”) H = “<H2>” + H + “</H2>”;
else if (this.hstyle == “h3”) H = “<H3>” + H + “</H3>”;
else if (this.hstyle == “h4”) H = “<H4>” + H + “</H4>”;
if (this.hstyle == “fancyheader”) H = “<table width=’75%’>” +
“<tr><td bgcolor=’#6060ff’ align=’left’ valign=’top’>” +
“<H1><FONT COLOR=’white’>” + H +
“</FONT></H1>” + “</td></tr></table>”;
else if (this.hstyle == “italics”)
H = “<I>” + H + “</I>”;

var M = “<FONT FACE=’arial’>” + this.message + “</FONT>”;
if (this.mstyle == “plain”) {}
if (this.mstyle == “italics”) M = M.italics();
else if (this.mstyle == “bold”) M = M.bold();

var htmlpage = “”;
if (this.hstyle.indexOf(“header”)>=0)
htmlpage = H + M;
else htmlpage = H + “<BR>” + M;
return htmlpage;
}

function helpbox(name, hm, width, height, bgcolor) {
this.name = name;
this.helpmessage = hm;
this.timerHandle = null;
this.windowHandle = null;
this.DEFAULTWIDTH = 300;
this.DEFAULTHEIGHT = 300;
this.DEFAULTBGCOLOR = “#ffffcc”;
this.POPUPDELAY = 100;
if (width) this.width = width;
else this.width = this.DEFAULTWIDTH;
if (height) this.height = height;
else this.height = this.DEFAULTHEIGHT;
if (bgcolor) this.bgcolor = bgcolor;
else this.bgcolor = this.DEFAULTBGCOLOR;
return this;
}
function startHelp(msgindex) {
var cmdstr=”top.” + this.name + “.showHelp(‘” + msgindex + “‘)”;
this.timerHandle = setTimeout(cmdstr, this.POPUPDELAY);
}
function showHelp(msgindex) {
if (!this.windowHandle || !this.windowHandle.name || this.windowHandle.name==””)
this.windowHandle = window.open(
“”,
“subWindow”,
“toolbar=no,” +
“location=no,” +
“directories=no,” +
“status=no,” +
“menubar=no,” +
“scrollbars=no,” +
“resizable=no,” +
“width=” + this.width + “,” +
“height=” + this.height
);
else
this.windowHandle.focus();
this.windowHandle.document.open();
var to_page =
“<HTML>n” +
“<BODY BGCOLOR='” + this.bgcolor + “‘><P>” +
this.helpmessage[msgindex].show() +
“</BODY></HTML>n”;
this.windowHandle.document.write(to_page);
this.windowHandle.document.close();
}
function clearHelp() {
clearTimeout(this.timerHandle);
if (this.windowHandle && this.windowHandle.name) {
this.windowHandle.close();
this.windowHandle=null;
}
}
new helpbox();
helpbox.prototype.startHelp = startHelp;
helpbox.prototype.showHelp = showHelp;
helpbox.prototype.clearHelp = clearHelp;

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@balloonbuffoonApr 10.2006 — Find the part that's black, add what's red:
[CODE]this.windowHandle = window.open(
"",
"subWindow",
"toolbar=no," +
"location=no," +
"directories=no," +
"status=no," +
"menubar=no," +
"scrollbars=no," +
"resizable=no," +
"width=" + this.width + "," +
"height=" + this.height [COLOR=Red]+
"left=0,top=0"[/COLOR]
);[/CODE]

You can make "left" and "top" equal whatever you want to position the window.

--Steve
Copy linkTweet thisAlerts:
@erik_1976authorApr 10.2006 — That did it. I appreciate your help!!
Copy linkTweet thisAlerts:
@balloonbuffoonApr 10.2006 — No problem!

--Steve
×

Success!

Help @erik_1976 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...