Popup assistance needed

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Popup assistance needed

Post by fredlongworthhighschool »

On my website I use the following bit of code to throw up a pop-up window:

Code: Select all

<!-- Open photo in new window -->
<!-- Opens photo in its raw image format -->
<script language="JavaScript">

function openPhoto(imgSrc,imgWidth,imgHeight,strCaption){
	var leftPosition = (screen.width-imgWidth)/2;
	var topPosition = (screen.height-imgHeight)/2-25;
	objImage = window.open("", "_blank","width="+imgWidth+",height="+imgHeight+",left="+leftPosition+",top="+topPosition);
	objImage.document.open();
	objImage.document.write("<html><head><title>"+strCaption+"</title><meta http-equiv=\"imagetoolbar\" content=\"no\"></head><body bgcolor=\"#000000\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onLoad=\"javascript:focus();\" onBlur=\"javascript:window.close();\"><img src=\""+imgSrc+"\" width=\""+imgWidth+"\" height=\""+imgHeight+"\" alt=\""+strCaption+"\"></body></html>");
	objImage.document.close();
}

openPhoto('images/webuse_notice.gif',570,250,'Important Notice');

</script>
The thing is I don't know how to put this option in where I click on a submenu item.

Thanks

Andy

EDIT: Added following...

I'm looking into using an IFRAME to see if this will do the job.
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Code: Select all

aI("text=See Photo1;url=javascript:openPhoto('image.gif',300,300,'Fun Photo');;");
This work?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

It did! Thanks Dave. I had to put the function immediately before the Milonic calls.
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
Post Reply