I've written the following javascript code to create a popup window for viewing a graphic image. Code as follows:
<!-- JavaScript file contents
<!-- This JavaScript function will popup a window for fullsize
<!-- viewing of an image file that is passed from calling routine
function PopupImageViewer(image_file){
photo = new Image();
photo.src = image_file;
CheckImageFile(image_file);
}
function CheckImageFile(image_file){
if((photo.width!=0)&&(photo.height!=0)){
ViewPhoto(image_file);
} else{
// In the event the file is new, need to resend image to this routine
resend="CheckImageFile('"+image_file+"')";
interval=setTimeout(resend,20);
}
}
function ViewPhoto(image_file){
// Need to add 25 pixel border around image for viewing on PC and MACS
win_w=photo.width+25;
win_h=photo.height+100;
win_l=(screen.width - photo.width) / 2
win_t=(screen.height - photo.height) / 2
scroll_option = "no"
resize_option = "no"
window_attributes = "toolbar=no,location=no,directories=no,status=no,menubar=no,"
window_attributes += "width="+win_w+",height="+win_h+",top="+win_t+",left="+win_l+",scrollbars="+scroll_option+",resizable="+resize_option;
view_image=window.open(image_file,"ImageViewer",window_attributes)
view_image.document.open()
view_image.document.write('<html>')
view_image.document.write('<head>')
view_image.document.write('<title>Image Viewer</title>')
view_image.document.write('</head>')
// In case we want some text above the image or a specific body color
// view_image.document.write('<body bgcolor="white"><h3>Image Viewer</h3>')
// view_image.document.write('</p>')
// view_image.document.write('</body>')
// In case we want a CANCEL button to close the window
view_image.document.write('</html>')
view_image.document.write('<img src="'+image_file+'">')
view_image.document.write('</p>')
view_image.document.write('<center><INPUT TYPE=button NAME="CLOSE" VALUE="CLOSE" onClick="self.close()"></center>');
view_image.document.close()
// If the popup window goes beneath the main window, this will
// bring it to the top
view_image.resizeTo(win_w,win_h); // absolute positioning
view_image.window.focus();
}
This works fine on Windows XP (Internet Explorer) but doesn't work at all on Mac OS (Internet Explorer).
Any ideas??
thanx
crandym
javascript popup on mac
Moderator: General Moderators
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
What version of IE on the Mac are you using? Traditionally, IE was crap for support of anything other than HTML and embedded objects. My advice would be to tell your co-worker to move to Safari, Firefox, or Camino. While this would possibly get around your problem, it would also reduce the number of problems in the future. IE on the Mac will ALWAYS have problems showing pages that aren't 100% standards compliant. Changing browsers will make your and your co-worker's lives much simpler. (Plus IE on the Mac is not longer supported by Microsoft)
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm
As an old school Mac evangelista, I would say check things out in Safari. If it works in Safari, don't worry about it. IE on the Mac is abandoned. It lags so far behind the PC version and behind the other Mac browsers as to border on unusable. Safari other non-IE browsers now constitue the MacOSX user's web browser of choice by a substantial margin. And OS9 users can't really have any realistic expectation offorward compatibility at this point.
-
ilovetoast
- Forum Contributor
- Posts: 142
- Joined: Thu Jan 15, 2004 7:34 pm