Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a window in Netscape vs. IE

Status
Not open for further replies.

jpan99

IS-IT--Management
Feb 28, 2001
1
US
I'm new to javascript so I hope someone can help. I found a cool script that opens an expanding window of a specified size and feeds in the html page. It works great, in IE, but in Netscape it just changes the page you're on to the new html page, it does not open another window.

I'm trying to write something that says "if IE, open the expanding window, else open a pop-up window." I don't want a full size window because the pages I'm popping do not have navigation, so the user needs to be able to close the window when done reading the material. I really like the cool expanding window and want to be able to have this feature for IE users yet still have a viable alternative for Netscape users. (yes, I do want to have my cake and eat it too!)

I can't seem to figure this out, I've managed to get the pop-up window to load in Netscape at the same time the epanding window loads in IE, but I can't get the new html page to fill into the pop-up window.

Here is the original script for the expanding window. Can anyone help me?
============
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Begin
function expandingWindow(website) {
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7; // horizontal scrolling speed (higher = slower)
var leftdist = 0; // distance to left edge of window
var topdist = 0; // distance to top edge of window
if (document.all) {
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open(&quot;&quot;,&quot;&quot;,&quot;left=&quot; + leftdist + &quot;,top=&quot; + topdist + &quot;,width=1,height=1,scrollbars=yes&quot;);
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
sizer.resizeTo(&quot;1&quot;, sizeheight);
}
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
sizer.resizeTo(sizewidth, sizeheight);
}
sizer.location = website;
}
else
window.location = website;
}
// End -->
</script>



<BODY>

<a href=&quot; onClick=&quot;expandingWindow(' false;&quot;>Open Tek-Tips!</a>

<p>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top