Forum Moderators: open
i haven't got any experience with java other than a bit of cutting and pasting but...
i was wondering if it is possible to use java(script) to have the source window and a newly clicked on window to both share the screen 50/50, vertically tiled?
the application is for an order sheet with a link on it to the store so that a bulk purchaser can quickly add multiple items by copying and pasting the product codes into an email form. without having to keep opening different windows.
thanks a lot in advance for your advice and suggestions.
jOSEPH
Here is a function that should do what you want, I think. It opens a second window and tiles the current window and the new window vertically. To try it out, put the function and the button in a page and create a second html page called lower_tile.htm
<head>
<script type="text/javascript">
<!--
var newWin='not a window yet'
function tileMe(){
//move window to top left
self.moveTo(0,0)
//resize window to 800px wide by 1/2 screen height high
self.resizeTo(800,screen.availHeight/2)
//if second window not opened yet, open it
if (typeof(newWin)!='object'){newWin=window.open('lower_tile.htm')}
//try...catch statement to trap for error--in the event the user
//closes lower_tile.htm, it will reopen it and resize it
try{
myval2=newWin.document.title
}
catch(error){
newWin=window.open('lower_tile.htm')
}
//if newWin is an object (a window), move to lower half of screen
//and resize to 800px wide by 1/2 screen height high
if (typeof(newWin)=='object'){
newWin.moveTo(0,screen.availHeight/2)
newWin.resizeTo(800,screen.availHeight/2)
}
}
//-->
</script>
</head>
<body >
<button onclick="tileMe()">Open second window</button>
</body>
Hope this helps,
ajkimoto
that is exactly what i had in mind,
one other thing if you don't mind?
I was wondering if there was any way to open the new window in stripped down fashion so that the user has the maximum amount of screen to see the content of the second window?
by stripped down - i mean without the various toolbars at the top of the browser window -
thanks again for your help :-)
You can indeed open a 'stripped down' window by passing some additional arguments in the window.open() command. For example:
window.open("yourpage.htm", "yourwindow", "width=400, height=300, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes");
opens a window with the following characteristics:
containing yourpage.htm
with the logical name yourwindow (can be used to reference the window in javascript code)
and with the following features:
width 400px
height 300px
no location bar
no menubar
no statusbar
no toolbar
with scrollbars
freely resizeable
You can use any or all of these window features to customize your popup window.
ajkimoto