Eulibrius7
04-25-2004, 02:42 AM
I have an image gallery and with onClick Popup window functionality. I'm not a native programmer so it's mostly cut & paste & modify. I'm much better @ ASP than Javascript so I have such a difficult time when it comes to JS. Anyway, the aforementioned functionality works fine as it is but I would like to make it possible for users be able to click on the image in the popup window to close itself or anywhere within the popup window. The problem I'm having is that I can't integrate the necessary code that would make this possible...I've included the URL of the gallery and Code Snippets below. Thank you in advance to anyone who can offer any assistance.
http://dox.bounceme.net/pics.asp?type_id=Cars&name_id=cmeft&record_name=Chrysler%20ME-Four%20Twelve
--------------------------------------------------------
function popup(url,windowname,width,height) {
width=(width)?width:screen.width/3;
height=(height)?height:screen.height/3;
var screenX = (screen.width/2 - width/2);
var screenY = (screen.height/2 - height/2);
var features= "width=" + width + ",height=" + height;
features += ",screenX=" + screenX + ",left=" + screenX;
features += ",screenY=" + screenY +",top=" + screenY;
var mywin=window.open(url, windowname, features);
if (mywin)
mywin.focus();
return mywin;
}
var myimage = new Image();
var popupwin=null;
myimage.onload=function(){popupwin=popup(this.src,"pic",this.width+20,this.height+20)}
function foo(what){
if (popupwin && !popupwin.closed)popupwin.close();
myimage.src=what;}
-------------------------------------------------------------
onClick = "foo(this.href);return false;"
http://dox.bounceme.net/pics.asp?type_id=Cars&name_id=cmeft&record_name=Chrysler%20ME-Four%20Twelve
--------------------------------------------------------
function popup(url,windowname,width,height) {
width=(width)?width:screen.width/3;
height=(height)?height:screen.height/3;
var screenX = (screen.width/2 - width/2);
var screenY = (screen.height/2 - height/2);
var features= "width=" + width + ",height=" + height;
features += ",screenX=" + screenX + ",left=" + screenX;
features += ",screenY=" + screenY +",top=" + screenY;
var mywin=window.open(url, windowname, features);
if (mywin)
mywin.focus();
return mywin;
}
var myimage = new Image();
var popupwin=null;
myimage.onload=function(){popupwin=popup(this.src,"pic",this.width+20,this.height+20)}
function foo(what){
if (popupwin && !popupwin.closed)popupwin.close();
myimage.src=what;}
-------------------------------------------------------------
onClick = "foo(this.href);return false;"