Hi,
90-1 that I should have posted this elsewhere but I wasn't sure where would be better. Following are two pages to provide a popup in the same page but it doesn't work so perhaps you could tell me why ?
---------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<!--BEGIN Pop-up Images Script------------------------------------------->
<SCRIPT Language="JavaScript">
<!--
// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at
var pic = null
var popImg = null // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"
function openPopImg(picName, windowTitle, windowWidth, windowHeight){
closePopImg()
picTitle = windowTitle
imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
popImg = window.open(picName, imgWinName,
"toolbar=no,scrollbars=no,resizable=no,width="
+ (parseInt(windowWidth)+20) + ",height="
+ (parseInt(windowHeight)+15))
}
function closePopImg(){ // close pop-up window if it is open
if (navigator.appName != "Microsoft Internet Explorer"
|| parseInt(navigator.appVersion) >=4) //do not close if early IE
if(popImg != null) if(!popImg.closed) popImg.close()
}
function setStatus(msg){
status = msg
return true
}
//-->
</SCRIPT>
<SCRIPT Language="JavaScript1.1">
<!--
// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false
function openPopImg(picName, windowTitle, windowWidth, windowHeight){
var i = 0
if(pic == picName && winOpen()){
popImg.focus()
}
else{
foundit = false
for(i=0; i<=noPic; i++){
if (priorPic == picName)
foundit = true
}
pic = picName
closePopImg()
picTitle = windowTitle
imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
if(!foundit){
priorPic[noPic++] = pic
}
popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
}
}
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width="
+ windowWidth + ",height=" + windowHeight
return window.open("pimg.htm", imgWinName, winFeatures)
}
function winOpen(){
if(popImg != null){
if(popImg.closed != true) return true; else return false
}
else
return false
}
//-->
</SCRIPT>
<SCRIPT Language="JavaScript1.2">
<!--
// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var leftX = 20 // distance of window's left side from left of screen
var topY = 20 // distance of window's top side from top of screen
var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width="
+ windowWidth + ",height=" + windowHeight
if (leftX>0){
winFeatures += ",screenX=" + leftX + ",left=" + leftX
+ ",screenY=" + topY + ",top=" + topY
}
return window.open("pimg.htm", imgWinName, winFeatures)
}
//-->
</SCRIPT>
<!--END Pop-up Images Script-------------------------------------------->
</head>
<body
<A HREF="JAVASCRIPTpenPopImg('bigmap.jpg', 'Map', '355', '355')"
onMouseOver="return setStatus('Click to display picture.')"
onMouseOut="return setStatus('')">
<img src="map.jpg" alt="Route" width="123" height="123"></A></body>
</html>
-------------------
<HTML>
<HEAD>
<!--
This code is part of a Pop-up image Script that is
available at --->
<TITLE>Loading</TITLE>
<SCRIPT Language="JavaScript">
<!--
function fabricatePage(){
var htmlStr =
'<HTML><HEAD><TITLE>' + window.opener.picTitle + '</TITLE></HEAD>'
+ '<BODY background="' + window.opener.pic + '"></BODY></HTML>'
document.open()
document.write(htmlStr)
document.close()
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#CCCCCC" onLoad="fabricatePage()">
<SCRIPT Language="JavaScript">
<!--
if(!window.opener.foundit){
document.write("Loading Picture...<BR>"
document.write('<img src="' + window.opener.pic + '" width=100% height=80%>')
document.close()
}
//-->
</SCRIPT>
</BODY>
</HTML>
-----------
The above pages are stored in the same folder as the two jpgs. I would also like to add another popup to my page which would not be an image file but could be either htm or txt.
thanks for your help,
Mike
The page will be used on my site at
90-1 that I should have posted this elsewhere but I wasn't sure where would be better. Following are two pages to provide a popup in the same page but it doesn't work so perhaps you could tell me why ?
---------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<!--BEGIN Pop-up Images Script------------------------------------------->
<SCRIPT Language="JavaScript">
<!--
// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at
var pic = null
var popImg = null // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"
function openPopImg(picName, windowTitle, windowWidth, windowHeight){
closePopImg()
picTitle = windowTitle
imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
popImg = window.open(picName, imgWinName,
"toolbar=no,scrollbars=no,resizable=no,width="
+ (parseInt(windowWidth)+20) + ",height="
+ (parseInt(windowHeight)+15))
}
function closePopImg(){ // close pop-up window if it is open
if (navigator.appName != "Microsoft Internet Explorer"
|| parseInt(navigator.appVersion) >=4) //do not close if early IE
if(popImg != null) if(!popImg.closed) popImg.close()
}
function setStatus(msg){
status = msg
return true
}
//-->
</SCRIPT>
<SCRIPT Language="JavaScript1.1">
<!--
// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false
function openPopImg(picName, windowTitle, windowWidth, windowHeight){
var i = 0
if(pic == picName && winOpen()){
popImg.focus()
}
else{
foundit = false
for(i=0; i<=noPic; i++){
if (priorPic == picName)
foundit = true
}
pic = picName
closePopImg()
picTitle = windowTitle
imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
if(!foundit){
priorPic[noPic++] = pic
}
popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
}
}
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width="
+ windowWidth + ",height=" + windowHeight
return window.open("pimg.htm", imgWinName, winFeatures)
}
function winOpen(){
if(popImg != null){
if(popImg.closed != true) return true; else return false
}
else
return false
}
//-->
</SCRIPT>
<SCRIPT Language="JavaScript1.2">
<!--
// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var leftX = 20 // distance of window's left side from left of screen
var topY = 20 // distance of window's top side from top of screen
var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width="
+ windowWidth + ",height=" + windowHeight
if (leftX>0){
winFeatures += ",screenX=" + leftX + ",left=" + leftX
+ ",screenY=" + topY + ",top=" + topY
}
return window.open("pimg.htm", imgWinName, winFeatures)
}
//-->
</SCRIPT>
<!--END Pop-up Images Script-------------------------------------------->
</head>
<body
<A HREF="JAVASCRIPTpenPopImg('bigmap.jpg', 'Map', '355', '355')"
onMouseOver="return setStatus('Click to display picture.')"
onMouseOut="return setStatus('')">
<img src="map.jpg" alt="Route" width="123" height="123"></A></body>
</html>
-------------------
<HTML>
<HEAD>
<!--
This code is part of a Pop-up image Script that is
available at --->
<TITLE>Loading</TITLE>
<SCRIPT Language="JavaScript">
<!--
function fabricatePage(){
var htmlStr =
'<HTML><HEAD><TITLE>' + window.opener.picTitle + '</TITLE></HEAD>'
+ '<BODY background="' + window.opener.pic + '"></BODY></HTML>'
document.open()
document.write(htmlStr)
document.close()
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#CCCCCC" onLoad="fabricatePage()">
<SCRIPT Language="JavaScript">
<!--
if(!window.opener.foundit){
document.write("Loading Picture...<BR>"
document.write('<img src="' + window.opener.pic + '" width=100% height=80%>')
document.close()
}
//-->
</SCRIPT>
</BODY>
</HTML>
-----------
The above pages are stored in the same folder as the two jpgs. I would also like to add another popup to my page which would not be an image file but could be either htm or txt.
thanks for your help,
Mike
The page will be used on my site at