First of all, Thanks to all who read and especially to those who reply and sorry about the width of this post!
I have a script on a page that uses the on_click to open a page with restricted size and controls in a new window.
I would like to know how to add more links to that script so that more widows will open up when clicked on
without duplicatin the entire script.
Below is what I am currently using (found it on dynamicdrive, I think):
function open_win(what_link){
var the_url = "calcs/piti.htm"
var the_x = 320;
var the_y = 480;
the_x -= 0;
the_y -= 0;
var how_wide = screen.availWidth;
var how_high = screen.availHeight;
if(what_link != ""
{the_url=what_link;}
var the_toolbar = "no";
var the_addressbar = "no";
var the_directories = "no";
var the_statusbar = "no";
var the_menubar = "no";
var the_scrollbars = "no";
var the_do_resize = "no";
var the_copy_history = "no";
top_pos = (how_high/2) - (the_y/2);
left_pos = (how_wide/2) - (the_x/2);
if (window.outerWidth ){
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
site=open(the_url, "DisplayWindow", option);
var Opera = (navigator.userAgent.indexOf('Opera') != -1);
if(Opera){
site.resizeTo(the_x,the_y);
site.moveTo(0,0);
}
}
else
{
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
site=open('', "DisplayWindow", option);
site.location=the_url;
if(site.open){site.focus();return false;}
site.resizeTo(the_x,the_y);
}
}
Of course all of the script tagging is in its proper location and the page works fine right now!
Hope someone can make heads or tails of this to allow multiple links.
Thanks again!
Seecke
P.S. Again, sorry about the width of this post.
I have a script on a page that uses the on_click to open a page with restricted size and controls in a new window.
I would like to know how to add more links to that script so that more widows will open up when clicked on
without duplicatin the entire script.
Below is what I am currently using (found it on dynamicdrive, I think):
function open_win(what_link){
var the_url = "calcs/piti.htm"
var the_x = 320;
var the_y = 480;
the_x -= 0;
the_y -= 0;
var how_wide = screen.availWidth;
var how_high = screen.availHeight;
if(what_link != ""
var the_toolbar = "no";
var the_addressbar = "no";
var the_directories = "no";
var the_statusbar = "no";
var the_menubar = "no";
var the_scrollbars = "no";
var the_do_resize = "no";
var the_copy_history = "no";
top_pos = (how_high/2) - (the_y/2);
left_pos = (how_wide/2) - (the_x/2);
if (window.outerWidth ){
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",outerWidth="+the_x+",outerHeight="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
site=open(the_url, "DisplayWindow", option);
var Opera = (navigator.userAgent.indexOf('Opera') != -1);
if(Opera){
site.resizeTo(the_x,the_y);
site.moveTo(0,0);
}
}
else
{
var option = "toolbar="+the_toolbar+",location="+the_addressbar+",directories="+the_directories+",status="+the_statusbar+",menubar="+the_menubar+",scrollbars="+the_scrollbars+",resizable="+the_do_resize+",Width="+the_x+",Height="+the_y+",copyhistory="+the_copy_history+",left="+left_pos+",top="+top_pos;
site=open('', "DisplayWindow", option);
site.location=the_url;
if(site.open){site.focus();return false;}
site.resizeTo(the_x,the_y);
}
}
Of course all of the script tagging is in its proper location and the page works fine right now!
Hope someone can make heads or tails of this to allow multiple links.
Thanks again!
Seecke
P.S. Again, sorry about the width of this post.