PDA

View Full Version : Pop Up window generator



tahano3
02-22-2005, 06:08 PM
Erik's pop-up window generator
http://www.dynamicdrive.com/dynamicindex8/popwin.htm

<script language="javascript" type="text/javascript">
<!--
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
/var win=null;
var w=100:
var h=100;
var pos='center'
var scroll='no'/
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor
(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?
Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random")||pos==null)
{LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',
scrollbars='+scroll+',location=yes,directories=no,status=no,menubar=no,
toolbar=no,resizable=no';
win=window(mypage,myname,settings);}
// -->
</script>

<SCRIPT LANGUAGE="javascript">
<!--
window.open('Feedback_form.html','newwindow',config='height=100,
width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,
directories=no,status=no')
-->
</SCRIPT>

While I may be new to java, I do have experience in programming(back when C was fairly new and assembler was a required skill). Have messed w/ VBA and C++ some now. Logic is logic and syntax is relevant.
By itself, this code is fairly straight forward and in some program like Frontpage or Adobe golive or whatever it'd probably work great.
Here's my prob though.
I'm using a off-site program to build my website. Like any software, it keeps the user from having to "hard code" certain aspects and properties.(i.e. background properties/images, locations of text/images, yah-de yah, just click/build/choose properties)
To import HTML or Java into this enviornment, I have two choices.
Page Properties/Page Header(Body? :confused: ) and type in HTML code(only).
Second, insert a "Literal Componet" to the page itself(HTML or Java).
My goal is to have a button on index.html(which I may have to hardcode as apposed to "their" navigation templates and have tried, works but does not import properties of page Feedback_form.html) and open up a sized feedback form(calling a subroutine?)
The simplest solution would be HTML code that would define size and position of new window. (and then it may not import defined properties of "populate w/ page.html)
Second, I'm not understanding/doing wrong the window.open/onfocus/onopen/self commands.
Third, not understanding the aspect/limitations of "their" literal component.
Fourth, I'll have to hard code the entire thing.
Any suggestions would be greatly appreciated.
P.S. the reason for the vars at the top was a attempt to apply to "self"