Using Opera? That's the only browser I know of that will automatically center the image in the frame. All others (IE, Google Chrome, Safari, and FireFox) that I tested open it top left aligned.
What's happening is that since you are opening the image itself in the frame (as opposed to a page with the image on it), the browser decides how to orient the image. As I say, all but Opera (as far as I know) will top left align it. Opera users generally are used to this, so I wouldn't worry about it.
However, if you really need to control the presentation of the image in all browsers, change:
Code:
//Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
var popupsetting=[0, "width=500px, height=400px, scrollbars, resizable"]
to:
Code:
//Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
var popupsetting=[1, ""]
And change:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open(imgsrc.href, "popwin", popupsetting[1])
popwin.focus()
return false
}
else
return true
}
to:
Code:
function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=window.open('', "CENTER")
popwin.document.write('<img src="' + imgsrc.href + '" alt="">');
popwin.document.close();
popwin.focus();
return false;
}
else
return true;
};
I've never actually tried this with a frame (new windows only), but it should work, as a frame is also considered as a window.
Bookmarks